From: Peter Crosthwaite Date: Tue, 27 May 2014 00:39:51 +0000 (-0700) Subject: qom: object: remove parent pointer when unparenting X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c28322d10cd5f0529605b48684d2b82c9eb9c020;p=qemu.git qom: object: 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: Paolo Bonzini --- diff --git a/qom/object.c b/qom/object.c index f49335f0cf..d5de8f6062 100644 --- a/qom/object.c +++ b/qom/object.c @@ -397,6 +397,7 @@ void object_unparent(Object *obj) } if (obj->parent) { object_property_del_child(obj->parent, obj, NULL); + obj->parent = NULL; } object_unref(obj); }