summary refs log tree commit diff stats
path: root/hw/vfio/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vfio/device.c')
-rw-r--r--hw/vfio/device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/vfio/device.c b/hw/vfio/device.c
index d32600eda1..d91c695b69 100644
--- a/hw/vfio/device.c
+++ b/hw/vfio/device.c
@@ -243,6 +243,13 @@ retry:
     return 0;
 }
 
+int vfio_device_get_region_fd(VFIODevice *vbasedev, int index)
+{
+        return vbasedev->region_fds ?
+               vbasedev->region_fds[index] :
+               vbasedev->fd;
+}
+
 int vfio_device_get_region_info_type(VFIODevice *vbasedev, uint32_t type,
                                      uint32_t subtype, struct vfio_region_info **info)
 {