diff options
| author | Cédric Le Goater <clg@redhat.com> | 2024-06-17 08:34:03 +0200 |
|---|---|---|
| committer | Cédric Le Goater <clg@redhat.com> | 2024-06-24 23:15:31 +0200 |
| commit | 504d297e10fdfe1b1243274e334abb0074ee69f4 (patch) | |
| tree | 8945e18123d6830160957e1afc6b0ff01157c769 /include/hw/vfio/vfio-container-base.h | |
| parent | 9550fdfd29f52d548d99aed2b1a002308ad6175a (diff) | |
| download | focaccia-qemu-504d297e10fdfe1b1243274e334abb0074ee69f4.tar.gz focaccia-qemu-504d297e10fdfe1b1243274e334abb0074ee69f4.zip | |
vfio/container: Change VFIOContainerBase to use QOM
VFIOContainerBase was made a QOM interface because we believed that a QOM object would expose all the IOMMU backends to the QEMU machine and human interface. This only applies to user creatable devices or objects. Change the VFIOContainerBase nature from interface to object and make the necessary adjustments in the VFIO_IOMMU hierarchy. Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include/hw/vfio/vfio-container-base.h')
| -rw-r--r-- | include/hw/vfio/vfio-container-base.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/include/hw/vfio/vfio-container-base.h b/include/hw/vfio/vfio-container-base.h index d505f63607..b079b76f68 100644 --- a/include/hw/vfio/vfio-container-base.h +++ b/include/hw/vfio/vfio-container-base.h @@ -34,6 +34,7 @@ typedef struct VFIOAddressSpace { * This is the base object for vfio container backends */ typedef struct VFIOContainerBase { + Object parent; const VFIOIOMMUClass *ops; VFIOAddressSpace *space; MemoryListener listener; @@ -96,17 +97,10 @@ void vfio_container_destroy(VFIOContainerBase *bcontainer); #define TYPE_VFIO_IOMMU_SPAPR TYPE_VFIO_IOMMU "-spapr" #define TYPE_VFIO_IOMMU_IOMMUFD TYPE_VFIO_IOMMU "-iommufd" -/* - * VFIOContainerBase is not an abstract QOM object because it felt - * unnecessary to expose all the IOMMU backends to the QEMU machine - * and human interface. However, we can still abstract the IOMMU - * backend handlers using a QOM interface class. This provides more - * flexibility when referencing the various implementations. - */ -DECLARE_CLASS_CHECKERS(VFIOIOMMUClass, VFIO_IOMMU, TYPE_VFIO_IOMMU) +OBJECT_DECLARE_TYPE(VFIOContainerBase, VFIOIOMMUClass, VFIO_IOMMU) struct VFIOIOMMUClass { - InterfaceClass parent_class; + ObjectClass parent_class; /* Properties */ const char *hiod_typename; |