From: Michael Roth Date: Tue, 25 Jul 2017 18:00:09 +0000 (+0200) Subject: spapr_iommu: pass object ownership to parent/owner X-Git-Tag: qemu-xen-4.11.0-rc1~185^2~29 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8dc9785ca0ff4e1c2268eb70a8156ed9696f97be;p=qemu-xen.git spapr_iommu: pass object ownership to parent/owner TCE table objects attach themselves to an owner as a child property. unref afterward to allow them to be finalized when their owner is finalized. Signed-off-by: Michael Roth Reviewed-by: Paolo Bonzini Reviewed-by: David Gibson Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 84d03df5ef..25c5f6d795 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -321,6 +321,7 @@ sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn) tmp = g_strdup_printf("tce-table-%x", liobn); object_property_add_child(OBJECT(owner), tmp, OBJECT(tcet), NULL); g_free(tmp); + object_unref(OBJECT(tcet)); object_property_set_bool(OBJECT(tcet), true, "realized", NULL);