vfio/spapr: Introduce a sPAPR VFIOIOMMU QOM interface
commitf221f641a2fe69c2ca3857759551470664b0bec8
authorCédric Le Goater <clg@redhat.com>
Tue, 19 Dec 2023 06:58:22 +0000 (19 07:58 +0100)
committerCédric Le Goater <clg@redhat.com>
Fri, 5 Jan 2024 20:25:20 +0000 (5 21:25 +0100)
tree83780d991ce356d72a825b6a1eae4f30b2053dab
parent61d893f2cdb34a2b0255f9b5fbba6b49b94ff730
vfio/spapr: Introduce a sPAPR VFIOIOMMU QOM interface

Move vfio_spapr_container_setup() to a VFIOIOMMUClass::setup handler
and convert the sPAPR VFIOIOMMUOps struct to a QOM interface. The
sPAPR QOM interface inherits from the legacy QOM interface because
because both have the same basic needs. The sPAPR interface is then
extended with the handlers specific to the sPAPR IOMMU.

This allows reuse and provides better abstraction of the backends. It
will be useful to avoid compiling the sPAPR IOMMU backend on targets
not supporting it.

Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Tested-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/container.c
hw/vfio/spapr.c
include/hw/vfio/vfio-container-base.h