aboutsummaryrefslogtreecommitdiff
path: root/test/mocks.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-06-01 11:53:25 +0100
committerGitHub <noreply@github.com>2021-06-01 11:53:25 +0100
commit9ed077601004c5c72665010b893ace6d8709e244 (patch)
tree73d9db59d12ebec371cd59b4fd7d9b3c19de2740 /test/mocks.c
parentd69581a45fa1c720cb796eb829259739c0ee2c2f (diff)
downloadlibvfio-user-9ed077601004c5c72665010b893ace6d8709e244.zip
libvfio-user-9ed077601004c5c72665010b893ace6d8709e244.tar.gz
libvfio-user-9ed077601004c5c72665010b893ace6d8709e244.tar.bz2
fixes for VFIO_USER_DIRTY_PAGES (#537)
- we should only accept one range, not multiple ones - clearly define and implement argsz behaviour - we need to check if migration is configured - add proper test coverage; move existing testing to python Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'test/mocks.c')
-rw-r--r--test/mocks.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/test/mocks.c b/test/mocks.c
index 4f202d5..6e34d4a 100644
--- a/test/mocks.c
+++ b/test/mocks.c
@@ -62,11 +62,9 @@ static struct function funcs[] = {
{ .name = "dma_controller_add_region" },
{ .name = "dma_controller_remove_region" },
{ .name = "dma_controller_unmap_region" },
- { .name = "handle_dirty_pages" },
{ .name = "process_request" },
{ .name = "should_exec_command" },
{ .name = "migration_region_access_registers" },
- { .name = "handle_dirty_pages_get" },
{ .name = "handle_device_state" },
{. name = "vfio_migr_state_transition_is_valid" },
{ .name = "state_trans_notify" },
@@ -214,18 +212,6 @@ should_exec_command(vfu_ctx_t *vfu_ctx, uint16_t cmd)
return mock();
}
-int
-handle_dirty_pages(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg)
-{
- if (!is_patched("handle_dirty_pages")) {
- return __real_handle_dirty_pages(vfu_ctx, msg);
- }
- check_expected(vfu_ctx);
- check_expected(msg);
- errno = mock();
- return mock();
-}
-
ssize_t
migration_region_access_registers(vfu_ctx_t *vfu_ctx, char *buf, size_t count,
loff_t pos, bool is_write)
@@ -243,23 +229,6 @@ migration_region_access_registers(vfu_ctx_t *vfu_ctx, char *buf, size_t count,
return mock();
}
-int
-handle_dirty_pages_get(vfu_ctx_t *vfu_ctx,
- struct iovec **iovecs, size_t *nr_iovecs,
- struct vfio_user_bitmap_range *ranges, uint32_t size)
-{
- if (!is_patched("handle_dirty_pages_get")) {
- return __real_handle_dirty_pages_get(vfu_ctx, iovecs, nr_iovecs,
- ranges, size);
- }
- check_expected(vfu_ctx);
- check_expected(iovecs);
- check_expected(nr_iovecs);
- check_expected(ranges);
- check_expected(size);
- return mock();
-}
-
ssize_t
handle_device_state(vfu_ctx_t *vfu_ctx, struct migration *migr,
uint32_t device_state, bool notify) {