aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2022-04-19 10:35:24 +0100
committerGitHub <noreply@github.com>2022-04-19 10:35:24 +0100
commit9ad7474568a6c9f1fbb12fb8048f2083078a8144 (patch)
tree291ad39660c6bf075fe72eb3f8539d94200dfb27 /test
parentcdf824cf0229f0cad6679967293eb03aa48919fd (diff)
downloadlibvfio-user-9ad7474568a6c9f1fbb12fb8048f2083078a8144.zip
libvfio-user-9ad7474568a6c9f1fbb12fb8048f2083078a8144.tar.gz
libvfio-user-9ad7474568a6c9f1fbb12fb8048f2083078a8144.tar.bz2
use struct iovec for grouping buffer and length (#658)
This make it tidier and easier to pass to function the buffer and length, instead of passing the whole msg. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'test')
-rw-r--r--test/unit-tests.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/unit-tests.c b/test/unit-tests.c
index fcaaa2a..81288e2 100644
--- a/test/unit-tests.c
+++ b/test/unit-tests.c
@@ -70,15 +70,15 @@ mkmsg(enum vfio_user_command cmd, void *data, size_t size)
{
msg.hdr.cmd = cmd;
msg.hdr.msg_size = size;
- msg.in_data = data;
- msg.in_size = size;
+ msg.in.iov.iov_base = data;
+ msg.in.iov.iov_len = size;
if (nr_fds != 0) {
- msg.in_fds = fds;
- msg.nr_in_fds = nr_fds;
+ msg.in.fds = fds;
+ msg.in.nr_fds = nr_fds;
} else {
- msg.in_fds = NULL;
- msg.nr_in_fds = 0;
+ msg.in.fds = NULL;
+ msg.in.nr_fds = 0;
}
return &msg;
@@ -243,7 +243,7 @@ test_handle_dma_unmap(void **state UNUSED)
assert_int_equal(0x2000, vfu_ctx.dma->regions[0].info.iova.iov_len);
assert_int_equal(0x8000, vfu_ctx.dma->regions[1].info.iova.iov_base);
assert_int_equal(0x3000, vfu_ctx.dma->regions[1].info.iova.iov_len);
- free(msg.out_data);
+ free(msg.out.iov.iov_base);
}
static void