aboutsummaryrefslogtreecommitdiff
path: root/lib/libvfio-user.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-04-13 14:25:45 +0100
committerGitHub <noreply@github.com>2021-04-13 14:25:45 +0100
commit1c2301b05baefe4e224adb93e1b642df4edca3f2 (patch)
tree8548f01e4295d1d5a343712c8333369ed0ff5702 /lib/libvfio-user.c
parentb0cba8d875a19e1c086ca93844d68ff42f0b0a54 (diff)
downloadlibvfio-user-1c2301b05baefe4e224adb93e1b642df4edca3f2.zip
libvfio-user-1c2301b05baefe4e224adb93e1b642df4edca3f2.tar.gz
libvfio-user-1c2301b05baefe4e224adb93e1b642df4edca3f2.tar.bz2
pci: use ERROR_INT() (#430)
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/libvfio-user.c')
-rw-r--r--lib/libvfio-user.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index b0bfbbe..c86713a 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -216,6 +216,9 @@ region_access(vfu_ctx_t *vfu_ctx, size_t region_index, char *buf,
if (region_index == VFU_PCI_DEV_CFG_REGION_IDX) {
ret = pci_config_space_access(vfu_ctx, buf, count, offset, is_write);
+ if (ret == -1) {
+ ret = -errno;
+ }
} else if (is_migr_reg(vfu_ctx, region_index) && vfu_ctx->migration != NULL) {
ret = migration_region_access(vfu_ctx, buf, count, offset, is_write);
} else {