aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2023-10-09 11:09:16 +0200
committerCédric Le Goater <clg@redhat.com>2023-10-18 10:10:49 +0200
commit3d779abafe9fff4fdbbc6c8dd2a6f6f901d98870 (patch)
tree711814cfb0020a76746999d5280b188090330b75 /include
parent0bddd88027679d3c34b7c754a13c7af002adbd99 (diff)
downloadqemu-3d779abafe9fff4fdbbc6c8dd2a6f6f901d98870.zip
qemu-3d779abafe9fff4fdbbc6c8dd2a6f6f901d98870.tar.gz
qemu-3d779abafe9fff4fdbbc6c8dd2a6f6f901d98870.tar.bz2
vfio/common: Introduce a global VFIODevice list
Some functions iterate over all the VFIODevices. This is currently achieved by iterating over all groups/devices. Let's introduce a global list of VFIODevices simplifying that scan. This will also be useful while migrating to IOMMUFD by hiding the group specificity. Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Suggested-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include')
-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 bf12e40..54905b9 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -131,6 +131,7 @@ typedef struct VFIODeviceOps VFIODeviceOps;
typedef struct VFIODevice {
QLIST_ENTRY(VFIODevice) next;
QLIST_ENTRY(VFIODevice) container_next;
+ QLIST_ENTRY(VFIODevice) global_next;
struct VFIOGroup *group;
VFIOContainer *container;
char *sysfsdev;
@@ -232,6 +233,7 @@ int vfio_kvm_device_del_fd(int fd, Error **errp);
extern const MemoryRegionOps vfio_region_ops;
typedef QLIST_HEAD(VFIOGroupList, VFIOGroup) VFIOGroupList;
+typedef QLIST_HEAD(VFIODeviceList, VFIODevice) VFIODeviceList;
extern VFIOGroupList vfio_group_list;
bool vfio_mig_active(void);