diff options
author | John Levon <john.levon@nutanix.com> | 2021-03-23 15:30:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 15:30:25 +0000 |
commit | 9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79 (patch) | |
tree | 3179a0a18319c3e863bd01c334de8a8fc7c68ab2 /test/mocks.c | |
parent | 8ba55dfb9bb54b773513e78d87d9ebe078384573 (diff) | |
download | libvfio-user-9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79.zip libvfio-user-9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79.tar.gz libvfio-user-9ed4c9e8c86ec04cbae067db18e1d31dd5f2ca79.tar.bz2 |
add -Wmissing-declarations (#399)
This is used by SPDK, and it's generally useful. This also uncovered some issues
in the test mocking.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'test/mocks.c')
-rw-r--r-- | test/mocks.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/test/mocks.c b/test/mocks.c index df10147..daeeb81 100644 --- a/test/mocks.c +++ b/test/mocks.c @@ -40,6 +40,7 @@ #include "dma.h" #include "migration.h" #include "../lib/private.h" +#include "../lib/tran_sock.h" struct function { @@ -126,9 +127,10 @@ __wrap_get_next_command(vfu_ctx_t *vfu_ctx, struct vfio_user_header *hdr, int __wrap_exec_command(vfu_ctx_t *vfu_ctx, struct vfio_user_header *hdr, - size_t size, int *fds, size_t *nr_fds, size_t **fds_out, - int *nr_fds_out, struct iovec *_iovecs, struct iovec **iovecs, - size_t *nr_iovecs, bool *free_iovec_data) + size_t size, int *fds, size_t nr_fds, int **fds_out, + size_t *nr_fds_out, struct iovec *_iovecs, + struct iovec **iovecs, size_t *nr_iovecs, + bool *free_iovec_data) { if (!is_patched(exec_command)) { return __real_exec_command(vfu_ctx, hdr, size, fds, nr_fds, fds_out, @@ -234,16 +236,6 @@ __wrap_cmd_allowed_when_stopped_and_copying(uint16_t cmd) } bool -__wrap_cmd_allowed_when_stopped(struct migration *migration) -{ - if (!is_patched(device_is_stopped)) { - return __real_device_is_stopped(migration); - } - check_expected(migration); - return mock(); -} - -bool __wrap_should_exec_command(vfu_ctx_t *vfu_ctx, uint16_t cmd) { if (!is_patched(should_exec_command)) { |