From: Peter Crosthwaite Date: Tue, 27 May 2014 00:39:51 +0000 (-0700) Subject: qom: Remove parent pointer when unparenting X-Git-Tag: qemu-xen-4.6.0-rc1~335^2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d15ae221eada39949b025d641f82d2c4a2ad8dde;p=qemu-upstream-4.6-testing.git 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 Signed-off-by: Andreas Färber --- diff --git a/qom/object.c b/qom/object.c index 3876618c2..7cefdf213 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); }