summary refs log tree commit diff stats
path: root/include/hw/vfio/vfio-common.h
diff options
context:
space:
mode:
authorJoao Martins <joao.m.martins@oracle.com>2024-07-19 13:04:49 +0100
committerCédric Le Goater <clg@redhat.com>2024-07-23 17:14:52 +0200
commit13e522f644e2b15fa857028a33e6a3b75e45158d (patch)
tree07e92ff3a1cd8a241c7866d2bc8b03dc4466001a /include/hw/vfio/vfio-common.h
parent07321a6d087d4ec9866cfb0c8b53692a59758976 (diff)
downloadfocaccia-qemu-13e522f644e2b15fa857028a33e6a3b75e45158d.tar.gz
focaccia-qemu-13e522f644e2b15fa857028a33e6a3b75e45158d.zip
vfio/pci: Extract mdev check into an helper
In preparation to skip initialization of the HostIOMMUDevice for mdev,
extract the checks that validate if a device is an mdev into helpers.

A vfio_device_is_mdev() is created, and subsystems consult VFIODevice::mdev
to check if it's mdev or not.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Diffstat (limited to 'include/hw/vfio/vfio-common.h')
-rw-r--r--include/hw/vfio/vfio-common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index e8ddf92bb1..98acae8c1c 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -116,6 +116,7 @@ typedef struct VFIODevice {
     DeviceState *dev;
     int fd;
     int type;
+    bool mdev;
     bool reset_works;
     bool needs_reset;
     bool no_mmap;
@@ -231,6 +232,7 @@ void vfio_region_exit(VFIORegion *region);
 void vfio_region_finalize(VFIORegion *region);
 void vfio_reset_handler(void *opaque);
 struct vfio_device_info *vfio_get_device_info(int fd);
+bool vfio_device_is_mdev(VFIODevice *vbasedev);
 bool vfio_attach_device(char *name, VFIODevice *vbasedev,
                         AddressSpace *as, Error **errp);
 void vfio_detach_device(VFIODevice *vbasedev);