aboutsummaryrefslogtreecommitdiff
path: root/samples/client.c
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2020-11-16 10:22:33 -0500
committerThanos <tmakatos@gmail.com>2020-11-18 16:50:58 +0000
commitd477770fb2fbefa1c1a7a067125891956c525d47 (patch)
tree9880a7cb62b5e06f100efa8b7c067420ed3563be /samples/client.c
parent943fe77b8099d4a9c5423320dc471a4ac14c634b (diff)
downloadlibvfio-user-d477770fb2fbefa1c1a7a067125891956c525d47.zip
libvfio-user-d477770fb2fbefa1c1a7a067125891956c525d47.tar.gz
libvfio-user-d477770fb2fbefa1c1a7a067125891956c525d47.tar.bz2
don't assert on error, instead respond with the relevant bit set
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/client.c')
-rw-r--r--samples/client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/samples/client.c b/samples/client.c
index bd8d2b3..afed47a 100644
--- a/samples/client.c
+++ b/samples/client.c
@@ -905,6 +905,14 @@ int main(int argc, char *argv[])
ret = migrate_from(sock);
}
+ /*
+ * Try to touch BAR0, we should get an error as the device is stopped.
+ */
+ ret = access_bar0(sock);
+ if (ret != EINVAL) {
+ fprintf(stderr, "expected an error, got %d instead\n", ret);
+ }
+
return 0;
}