On 11/08/2025 12:56, Cédric Le Goater wrote:

One more thing we could do :

@@ -105,14 +109,11 @@ vfio_container_get_page_size_mask(const VFIOContainerBase *bcontainer)
      return bcontainer->pgsizes;
  }
-#define TYPE_VFIO_IOMMU "vfio-iommu"
  #define TYPE_VFIO_IOMMU_LEGACY TYPE_VFIO_IOMMU "-legacy"
  #define TYPE_VFIO_IOMMU_SPAPR TYPE_VFIO_IOMMU "-spapr"
  #define TYPE_VFIO_IOMMU_IOMMUFD TYPE_VFIO_IOMMU "-iommufd"
  #define TYPE_VFIO_IOMMU_USER TYPE_VFIO_IOMMU "-user"

These type definitions would be better placed in the header files
defining the other software structures to which they relate.

   TYPE_VFIO_IOMMU_LEGACY  -> hw/vfio/vfio-container.h
   TYPE_VFIO_IOMMU_SPAPR   -> hw/vfio/vfio-container.h ?
   TYPE_VFIO_IOMMU_IOMMUFD -> hw/vfio/vfio-iommufd.h
   TYPE_VFIO_IOMMU_USER    -> hw/vfio-user/container.h

I don't know how possible that would be.

I can have a look at how feasible this is if you like? This pattern tends to be used a lot elsewhere and feels more intuitive to me.


ATB,

Mark.


Reply via email to