mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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:
parent
dddf83ab99
commit
e559706338
6 changed files with 29 additions and 26 deletions
|
@ -73,17 +73,10 @@ typedef struct VFIOMigration {
|
|||
bool initial_data_sent;
|
||||
} VFIOMigration;
|
||||
|
||||
typedef struct VFIOAddressSpace {
|
||||
AddressSpace *as;
|
||||
QLIST_HEAD(, VFIOContainer) containers;
|
||||
QLIST_ENTRY(VFIOAddressSpace) list;
|
||||
} VFIOAddressSpace;
|
||||
|
||||
struct VFIOGroup;
|
||||
|
||||
typedef struct VFIOContainer {
|
||||
VFIOContainerBase bcontainer;
|
||||
VFIOAddressSpace *space;
|
||||
int fd; /* /dev/vfio/vfio, empowered by the attached groups */
|
||||
MemoryListener listener;
|
||||
MemoryListener prereg_listener;
|
||||
|
@ -98,7 +91,6 @@ typedef struct VFIOContainer {
|
|||
QLIST_HEAD(, VFIOHostDMAWindow) hostwin_list;
|
||||
QLIST_HEAD(, VFIOGroup) group_list;
|
||||
QLIST_HEAD(, VFIORamDiscardListener) vrdl_list;
|
||||
QLIST_ENTRY(VFIOContainer) next;
|
||||
QLIST_HEAD(, VFIODevice) device_list;
|
||||
GList *iova_ranges;
|
||||
} VFIOContainer;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue