aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2022-11-22 13:11:54 +0000
committerGitHub <noreply@github.com>2022-11-22 13:11:54 +0000
commitff68d2e40fca63868c1fd046ad831522583ef9f4 (patch)
tree15017808e5a7f5882b652012eb064c64e7b3fbd6
parent14c0bc58e7278271ba22e6d31480da550db69a0c (diff)
downloadlibvfio-user-ff68d2e40fca63868c1fd046ad831522583ef9f4.zip
libvfio-user-ff68d2e40fca63868c1fd046ad831522583ef9f4.tar.gz
libvfio-user-ff68d2e40fca63868c1fd046ad831522583ef9f4.tar.bz2
fix shadow ioeventfd unit test (#726)
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
-rw-r--r--test/py/libvfio_user.py2
-rw-r--r--test/py/test_shadow_ioeventfd.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/py/libvfio_user.py b/test/py/libvfio_user.py
index fd09fa8..5f0872a 100644
--- a/test/py/libvfio_user.py
+++ b/test/py/libvfio_user.py
@@ -416,8 +416,8 @@ class vfio_user_sub_region_ioeventfd(Structure):
("type", c.c_uint32),
("flags", c.c_uint32),
("shadow_mem_fd_index", c.c_uint32),
+ ("shadow_offset", c.c_uint64),
("datamatch", c.c_uint64),
- ("shadow_offset", c.c_uint64)
]
diff --git a/test/py/test_shadow_ioeventfd.py b/test/py/test_shadow_ioeventfd.py
index c7cc4e5..e64c253 100644
--- a/test/py/test_shadow_ioeventfd.py
+++ b/test/py/test_shadow_ioeventfd.py
@@ -54,7 +54,7 @@ def test_shadow_ioeventfd():
efd = eventfd(flags=EFD_NONBLOCK)
ret = vfu_create_ioeventfd(ctx, VFU_PCI_DEV_BAR0_REGION_IDX, efd, 0x8,
- 0x16, 0, 0, shadow_fd=fo.fileno(), 0x10)
+ 0x16, 0, 0, fo.fileno(), 0x10)
assert ret == 0
ret = vfu_realize_ctx(ctx)
assert ret == 0
@@ -76,7 +76,7 @@ def test_shadow_ioeventfd():
assert ioevent.type == VFIO_USER_IO_FD_TYPE_IOEVENTFD_SHADOW
assert ioevent.flags == 0
assert ioevent.datamatch == 0
- assert ioevent.shadow_offset = 0x10
+ assert ioevent.shadow_offset == 0x10
assert len(newfds) == 2 # 2 FDs: eventfd plus shadow FD
cefd = newfds[0]