aboutsummaryrefslogtreecommitdiff
path: root/samples/gpio-pci-idio-16.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-05-24 10:42:42 +0100
committerGitHub <noreply@github.com>2021-05-24 10:42:42 +0100
commitbf3938dec68e1c820063db4f63aa2355c5703e4b (patch)
treeddb63a16a166d52ee8f5506f649faee79ada2240 /samples/gpio-pci-idio-16.c
parent300f87e1b02e979da8cec444249f09ea0ef167a0 (diff)
downloadlibvfio-user-bf3938dec68e1c820063db4f63aa2355c5703e4b.zip
libvfio-user-bf3938dec68e1c820063db4f63aa2355c5703e4b.tar.gz
libvfio-user-bf3938dec68e1c820063db4f63aa2355c5703e4b.tar.bz2
fix region offset handling (#485)
The specification states that the region offset given in the region info should be used as the "offset" when mmap()ing the region from the client side. However, the library instead implemented a fixed offset scheme similar to that of vfio - and no clients actually set up the file like that. Instead, let servers define their own offsets, and pass them through to clients as is. It's up to the server to decide how its backing file or files is organized. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/gpio-pci-idio-16.c')
-rw-r--r--samples/gpio-pci-idio-16.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/gpio-pci-idio-16.c b/samples/gpio-pci-idio-16.c
index f9caa04..7bffb5e 100644
--- a/samples/gpio-pci-idio-16.c
+++ b/samples/gpio-pci-idio-16.c
@@ -205,13 +205,13 @@ main(int argc, char *argv[])
vfu_pci_set_id(vfu_ctx, 0x494f, 0x0dc8, 0x0, 0x0);
ret = vfu_setup_region(vfu_ctx, VFU_PCI_DEV_BAR2_REGION_IDX, 0x100,
- &bar2_access, VFU_REGION_FLAG_RW, NULL, 0, -1);
+ &bar2_access, VFU_REGION_FLAG_RW, NULL, 0, -1, 0);
if (ret < 0) {
err(EXIT_FAILURE, "failed to setup region");
}
ret = vfu_setup_region(vfu_ctx, VFU_PCI_DEV_MIGR_REGION_IDX, migr_size,
- NULL, VFU_REGION_FLAG_RW, NULL, 0, -1);
+ NULL, VFU_REGION_FLAG_RW, NULL, 0, -1, 0);
if (ret < 0) {
err(EXIT_FAILURE, "failed to setup migration region");
}