vfio/container: Move space field to base container

Move the space field to the base object. Also the VFIOAddressSpace
now contains a list of base containers.

No functional change intended.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
Eric Auger 2023-11-02 15:12:32 +08:00 committed by Cédric Le Goater
parent dddf83ab99
commit e559706338
6 changed files with 29 additions and 26 deletions

View file

@ -24,12 +24,20 @@ typedef struct {
hwaddr pages;
} VFIOBitmap;
typedef struct VFIOAddressSpace {
AddressSpace *as;
QLIST_HEAD(, VFIOContainerBase) containers;
QLIST_ENTRY(VFIOAddressSpace) list;
} VFIOAddressSpace;
/*
* This is the base object for vfio container backends
*/
typedef struct VFIOContainerBase {
const VFIOIOMMUOps *ops;
VFIOAddressSpace *space;
QLIST_HEAD(, VFIOGuestIOMMU) giommu_list;
QLIST_ENTRY(VFIOContainerBase) next;
} VFIOContainerBase;
typedef struct VFIOGuestIOMMU {
@ -48,6 +56,7 @@ int vfio_container_dma_unmap(VFIOContainerBase *bcontainer,
IOMMUTLBEntry *iotlb);
void vfio_container_init(VFIOContainerBase *bcontainer,
VFIOAddressSpace *space,
const VFIOIOMMUOps *ops);
void vfio_container_destroy(VFIOContainerBase *bcontainer);