Skip to content

Commit

Permalink
vfio/container: Intoduce a new VFIOIOMMUClass::setup handler
Browse files Browse the repository at this point in the history
This will help in converting the sPAPR IOMMU backend to a QOM interface.

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>
  • Loading branch information
legoater committed Jan 5, 2024
1 parent 9812fee commit 61d893f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/vfio/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ static void vfio_iommu_legacy_class_init(ObjectClass *klass, void *data)
{
VFIOIOMMUClass *vioc = VFIO_IOMMU_CLASS(klass);

vioc->setup = vfio_legacy_setup;
vioc->dma_map = vfio_legacy_dma_map;
vioc->dma_unmap = vfio_legacy_dma_unmap;
vioc->attach_device = vfio_legacy_attach_device;
Expand Down
1 change: 1 addition & 0 deletions include/hw/vfio/vfio-container-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ struct VFIOIOMMUClass {
InterfaceClass parent_class;

/* basic feature */
int (*setup)(VFIOContainerBase *bcontainer, Error **errp);
int (*dma_map)(const VFIOContainerBase *bcontainer,
hwaddr iova, ram_addr_t size,
void *vaddr, bool readonly);
Expand Down

0 comments on commit 61d893f

Please sign in to comment.