summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Crosthwaite2014-05-27 02:39:51 +0200
committerAndreas Färber2014-06-30 21:13:30 +0200
commitd15ae221eada39949b025d641f82d2c4a2ad8dde (patch)
tree5d542dafe8a55f3a5103fab594168e92deacb30e
parentMerge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-2014063... (diff)
downloadqemu-d15ae221eada39949b025d641f82d2c4a2ad8dde.tar.gz
qemu-d15ae221eada39949b025d641f82d2c4a2ad8dde.tar.xz
qemu-d15ae221eada39949b025d641f82d2c4a2ad8dde.zip
qom: Remove parent pointer when unparenting
Certain parts of the QOM framework test this pointer to determine if an object is parented. Nuke it when the object is unparented to allow for reuse of an object after unparenting. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--qom/object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index 3876618c2e..7cefdf2137 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -402,6 +402,7 @@ void object_unparent(Object *obj)
}
if (obj->parent) {
object_property_del_child(obj->parent, obj, NULL);
+ obj->parent = NULL;
}
object_unref(obj);
}