]> git.proxmox.com Git - mirror_qemu.git/commit
qom: Assert that objects being destroyed have no parent
authorEduardo Habkost <ehabkost@redhat.com>
Tue, 15 Dec 2020 22:41:33 +0000 (17:41 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 2 Jan 2021 20:03:09 +0000 (21:03 +0100)
commit63f957ac96eba545ef60abebfc6741d06fd99ade
tree3edf4b22984ad54d61eafe678c994045d606d72b
parent08bdf5d44f999c92399ff73df00f2ea2c7ee04bd
qom: Assert that objects being destroyed have no parent

QOM reference counting bugs are often hard to detect, but there's
one kind of bug that's easier: if we are freeing an object but is
still attached to a parent, it means the reference count is wrong
(because the parent always hold a reference to their children).

Add an assertion to make sure we detect those cases.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20201215224133.3545901-3-ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom/object.c