mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
vfio/container: Introduce vfio_iommu_legacy_instance_init()
Just as we did for the VFIOContainerBase object, introduce an instance_init() handler for the legacy VFIOContainer object and do the specific initialization there. Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
2f7243cb8a
commit
b052f73cbe
1 changed files with 8 additions and 1 deletions
|
@ -639,7 +639,6 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as,
|
||||||
|
|
||||||
vfio_kvm_device_add_group(group);
|
vfio_kvm_device_add_group(group);
|
||||||
|
|
||||||
QLIST_INIT(&container->group_list);
|
|
||||||
vfio_address_space_insert(space, bcontainer);
|
vfio_address_space_insert(space, bcontainer);
|
||||||
|
|
||||||
group->container = container;
|
group->container = container;
|
||||||
|
@ -1183,6 +1182,13 @@ hiod_legacy_vfio_get_iova_ranges(HostIOMMUDevice *hiod, Error **errp)
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void vfio_iommu_legacy_instance_init(Object *obj)
|
||||||
|
{
|
||||||
|
VFIOContainer *container = VFIO_IOMMU_LEGACY(obj);
|
||||||
|
|
||||||
|
QLIST_INIT(&container->group_list);
|
||||||
|
}
|
||||||
|
|
||||||
static void hiod_legacy_vfio_class_init(ObjectClass *oc, void *data)
|
static void hiod_legacy_vfio_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
HostIOMMUDeviceClass *hioc = HOST_IOMMU_DEVICE_CLASS(oc);
|
HostIOMMUDeviceClass *hioc = HOST_IOMMU_DEVICE_CLASS(oc);
|
||||||
|
@ -1196,6 +1202,7 @@ static const TypeInfo types[] = {
|
||||||
{
|
{
|
||||||
.name = TYPE_VFIO_IOMMU_LEGACY,
|
.name = TYPE_VFIO_IOMMU_LEGACY,
|
||||||
.parent = TYPE_VFIO_IOMMU,
|
.parent = TYPE_VFIO_IOMMU,
|
||||||
|
.instance_init = vfio_iommu_legacy_instance_init,
|
||||||
.instance_size = sizeof(VFIOContainer),
|
.instance_size = sizeof(VFIOContainer),
|
||||||
.class_init = vfio_iommu_legacy_class_init,
|
.class_init = vfio_iommu_legacy_class_init,
|
||||||
}, {
|
}, {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue