summary refs log tree commit diff stats
path: root/hw/vfio/region.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vfio/region.c')
-rw-r--r--hw/vfio/region.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/vfio/region.c b/hw/vfio/region.c
index f5b8e3cbf1..d04c57db63 100644
--- a/hw/vfio/region.c
+++ b/hw/vfio/region.c
@@ -273,10 +273,7 @@ int vfio_region_mmap(VFIORegion *region)
             goto no_mmap;
         }
 
-        /* Use the per-region fd if set, or the shared fd. */
-        fd = region->vbasedev->region_fds ?
-             region->vbasedev->region_fds[region->nr] :
-             region->vbasedev->fd,
+        fd = vfio_device_get_region_fd(region->vbasedev, region->nr);
 
         map_align = (void *)ROUND_UP((uintptr_t)map_base, (uintptr_t)align);
         munmap(map_base, map_align - map_base);