summaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2014-05-26 17:39:51 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2014-07-01 10:20:41 +0200
commitc28322d10cd5f0529605b48684d2b82c9eb9c020 (patch)
treea797fc6251cb2ff393d2fe789963b1fd08229a25 /qom
parent654a36d857ff949e0d1989904b76f53fded9dc83 (diff)
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 <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c1
1 files changed, 1 insertions, 0 deletions
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);
}