aboutsummaryrefslogtreecommitdiff
path: root/samples/client.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-01-04 17:53:10 +0000
committerGitHub <noreply@github.com>2021-01-04 17:53:10 +0000
commit1fa90d5abecd896362e551b2bd2ec987d8f60a6b (patch)
tree6bcb22c92d2bf52c1baf6786a644d4abbbd09604 /samples/client.c
parent715b7963312002980b9eea5a695719cfdf2bf6e4 (diff)
downloadlibvfio-user-1fa90d5abecd896362e551b2bd2ec987d8f60a6b.zip
libvfio-user-1fa90d5abecd896362e551b2bd2ec987d8f60a6b.tar.gz
libvfio-user-1fa90d5abecd896362e551b2bd2ec987d8f60a6b.tar.bz2
re-work PCI config setup API (#198)
Split up vfu_pci_setup_config_hdr(): individual "helpers" like vfu_pci_set_id() are much simpler to use than making the user specify the values in header-formatted structs; and this way if we want to add additional helpers, we won't need to modify the existing functions. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/client.c')
-rw-r--r--samples/client.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/samples/client.c b/samples/client.c
index 7568afe..dbff008 100644
--- a/samples/client.c
+++ b/samples/client.c
@@ -983,7 +983,7 @@ int main(int argc, char *argv[])
*/
negotiate(sock, &server_max_fds, &pgsize);
- /* try to access a bogus region, we should het an error */
+ /* try to access a bogus region, we should get an error */
ret = access_region(sock, 0xdeadbeef, false, 0, &ret, sizeof ret);
if (ret != -EINVAL) {
errx(EXIT_FAILURE,
@@ -1006,10 +1006,11 @@ int main(int argc, char *argv[])
errx(EXIT_FAILURE, "failed to read PCI configuration space: %s\n",
strerror(-ret));
}
- assert(config_space.id.raw == 0xdeadbeef);
- assert(config_space.ss.raw == 0xcafebabe);
- assert(config_space.cc.pi == 0xab && config_space.cc.scc == 0xcd
- && config_space.cc.bcc == 0xef);
+
+ assert(config_space.id.vid == 0xdead);
+ assert(config_space.id.did == 0xbeef);
+ assert(config_space.ss.vid == 0xcafe);
+ assert(config_space.ss.sid == 0xbabe);
/* XXX VFIO_USER_DEVICE_RESET */
send_device_reset(sock);