aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2021-06-09 11:15:34 +0100
committerGitHub <noreply@github.com>2021-06-09 11:15:34 +0100
commit1abe697341061a6c16e4a5d28b20b5efa7035a81 (patch)
treed034333d573cf5228a03cb9466540a822a60ee20 /test
parent57684de8240fce4a277301a86a803842338762af (diff)
downloadlibvfio-user-1abe697341061a6c16e4a5d28b20b5efa7035a81.zip
libvfio-user-1abe697341061a6c16e4a5d28b20b5efa7035a81.tar.gz
libvfio-user-1abe697341061a6c16e4a5d28b20b5efa7035a81.tar.bz2
drop mappable flag from DMA map (#553)
The flags field belongs to VFIO and it's not a good idea to reuse as new VFIO flags can break things. Instead, we derive whether or not a region is mappable if a file descriptor is passed. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/libvfio_user.py1
-rw-r--r--test/py/test_dirty_pages.py4
-rw-r--r--test/unit-tests.c4
3 files changed, 2 insertions, 7 deletions
diff --git a/test/py/libvfio_user.py b/test/py/libvfio_user.py
index bdb812a..b276a82 100644
--- a/test/py/libvfio_user.py
+++ b/test/py/libvfio_user.py
@@ -156,7 +156,6 @@ VFU_REGION_FLAG_MEM = 4
VFIO_USER_F_DMA_REGION_READ = (1 << 0)
VFIO_USER_F_DMA_REGION_WRITE = (1 << 1)
-VFIO_USER_F_DMA_REGION_MAPPABLE = (1 << 2)
VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP = (1 << 0)
diff --git a/test/py/test_dirty_pages.py b/test/py/test_dirty_pages.py
index 5d4f6db..2c9be01 100644
--- a/test/py/test_dirty_pages.py
+++ b/test/py/test_dirty_pages.py
@@ -74,9 +74,7 @@ def test_dirty_pages_setup():
f.truncate(0x10000)
payload = vfio_user_dma_map(argsz=len(vfio_user_dma_map()),
- flags=(VFIO_USER_F_DMA_REGION_READ |
- VFIO_USER_F_DMA_REGION_WRITE |
- VFIO_USER_F_DMA_REGION_MAPPABLE),
+ flags=(VFIO_USER_F_DMA_REGION_READ | VFIO_USER_F_DMA_REGION_WRITE),
offset=0, addr=0x10000, size=0x10000)
hdr = vfio_user_header(VFIO_USER_DMA_MAP, size=len(payload))
diff --git a/test/unit-tests.c b/test/unit-tests.c
index 9e3fe00..9945bac 100644
--- a/test/unit-tests.c
+++ b/test/unit-tests.c
@@ -123,14 +123,12 @@ test_dma_map_mappable_without_fd(void **state UNUSED)
{
struct vfio_user_dma_map dma_map = {
.argsz = sizeof(dma_map),
- .flags = VFIO_USER_F_DMA_REGION_MAPPABLE
};
ret = handle_dma_map(&vfu_ctx,
mkmsg(VFIO_USER_DMA_MAP, &dma_map, sizeof(dma_map)),
&dma_map);
- assert_int_equal(-1, ret);
- assert_int_equal(errno, EINVAL);
+ assert_int_equal(0, ret);
}
static void