From 5cf52416e428836b1328ed47173a41948e1643bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 26 Mar 2025 08:51:00 +0100 Subject: [PATCH] vfio: Move Host IOMMU type declarations into their respective files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit These definitions don't have any use outside of their respective submodules. There is no need to expose them externally. Keep them private. Reviewed-by: Zhenzhong Duan Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-15-clg@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-16-clg@redhat.com Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 2 ++ hw/vfio/iommufd.c | 3 +++ include/hw/vfio/vfio-common.h | 5 ----- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index cc8cc0f2726..6ef53ee1870 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -34,6 +34,8 @@ #include "pci.h" #include "hw/vfio/vfio-container.h" +#define TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO TYPE_HOST_IOMMU_DEVICE "-legacy-vfio" + typedef QLIST_HEAD(VFIOGroupList, VFIOGroup) VFIOGroupList; static VFIOGroupList vfio_group_list = QLIST_HEAD_INITIALIZER(vfio_group_list); diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index a520d40afc0..2ec15bc2692 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -27,6 +27,9 @@ #include "pci.h" #include "vfio-iommufd.h" +#define TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO \ + TYPE_HOST_IOMMU_DEVICE_IOMMUFD "-vfio" + static int iommufd_cdev_map(const VFIOContainerBase *bcontainer, hwaddr iova, ram_addr_t size, void *vaddr, bool readonly) { diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 7d78eb85daf..bb11b8215a8 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -115,11 +115,6 @@ struct VFIODeviceOps { int (*vfio_load_config)(VFIODevice *vdev, QEMUFile *f); }; - -#define TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO TYPE_HOST_IOMMU_DEVICE "-legacy-vfio" -#define TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO \ - TYPE_HOST_IOMMU_DEVICE_IOMMUFD "-vfio" - void vfio_disable_irqindex(VFIODevice *vbasedev, int index); void vfio_unmask_single_irqindex(VFIODevice *vbasedev, int index); void vfio_mask_single_irqindex(VFIODevice *vbasedev, int index); -- 2.47.2