Make AddressSpaces QOM objects to ensure that they are destroyed when their owners are finalized and also to get a unique path for debugging output. The name arguments were used to distinguish AddresSpaces in debugging output, but they will represent property names after QOM-ification and debugging output will show QOM paths. So change them to make them more concise and also avoid conflicts with other properties. Signed-off-by: Akihiko Odaki --- hw/remote/iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/remote/iommu.c b/hw/remote/iommu.c index aac5c178ec81..89d79e9480da 100644 --- a/hw/remote/iommu.c +++ b/hw/remote/iommu.c @@ -54,7 +54,7 @@ static AddressSpace *remote_iommu_find_add_as(PCIBus *pci_bus, if (!elem->mr) { elem->mr = MEMORY_REGION(object_new(TYPE_MEMORY_REGION)); memory_region_set_size(elem->mr, UINT64_MAX); - address_space_init(&elem->as, NULL, elem->mr, NULL); + address_space_init(&elem->as, OBJECT(iommu), elem->mr, "as"); } qemu_mutex_unlock(&iommu->lock); @@ -73,7 +73,7 @@ void remote_iommu_unplug_dev(PCIDevice *pci_dev) elem = container_of(as, RemoteIommuElem, as); - address_space_destroy(&elem->as); + object_unparent(OBJECT(&elem->as)); object_unref(elem->mr); -- 2.51.0