]> git.ipfire.org Git - thirdparty/qemu.git/commit
qom: object_delete should unparent the object first
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Aug 2012 21:09:46 +0000 (23:09 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 28 Aug 2012 06:50:02 +0000 (01:50 -0500)
commit1d34dff02fad135a64266e670f01ac3c6a408fa1
treef55ab86fac480c0cdf67690737b89c7de1166375
parent5330a894ed44e18ba8eb038fbc1060eac34ad8bc
qom: object_delete should unparent the object first

object_deinit is only called when the reference count goes to zero,
and yet tries to do an object_unparent.  Now, object_unparent
either does nothing or it will decrease the reference count.
Because we know the reference count is zero, the object_unparent
call in object_deinit is useless.

Instead, we need to disconnect the object from its parent just
before we remove the last reference apart from the parent's.  This
happens in object_delete.  Once we do this, all calls to
object_unparent peppered through QEMU can go away.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit da5a44e8b0b727681fc33e8d94832d1cae48a788)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/acpi_piix4.c
hw/qdev.c
hw/xen_platform.c
qom/object.c