aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2020-10-22 08:36:38 -0400
committerThanos Makatos <thanos.makatos@nutanix.com>2020-10-22 11:11:37 -0400
commita7c7d91429f3f00122ae06852730a8d514d518f6 (patch)
treefa059fef972da8fd8205aa81172f0e84469c1e46 /samples
parent004f9b58f131638bb254791d0e7da36126ed08f7 (diff)
downloadlibvfio-user-a7c7d91429f3f00122ae06852730a8d514d518f6.zip
libvfio-user-a7c7d91429f3f00122ae06852730a8d514d518f6.tar.gz
libvfio-user-a7c7d91429f3f00122ae06852730a8d514d518f6.tar.bz2
include region header when replying to VFIO_USER_REGION_READ/VFIO_USER_REGION_WRITE
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/client.c b/samples/client.c
index bc0235e..7daa209 100644
--- a/samples/client.c
+++ b/samples/client.c
@@ -38,6 +38,7 @@
#include <sys/eventfd.h>
#include <time.h>
#include <err.h>
+#include <assert.h>
#include "../lib/muser.h"
#include "../lib/muser_priv.h"
@@ -310,11 +311,12 @@ access_bar0(int sock)
ret = send_recv_vfio_user_msg(sock, msg_id, VFIO_USER_REGION_READ,
&data.region_access, sizeof data.region_access,
- NULL, 0, NULL, &data.t, sizeof data.t);
+ NULL, 0, NULL, &data, sizeof data);
if (ret < 0) {
fprintf(stderr, "failed to read from BAR0: %s\n", strerror(-ret));
return ret;
}
+ assert(data.region_access.count == sizeof data.t);
printf("read from BAR0: %ld\n", data.t);