Received: from eggs.gnu.org ([2001:4830:134:3::10]:48067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzmHL-0003vq-K9 for qemu-devel@nongnu.org; Wed, 25 Jun 2014 08:26:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzmHF-0001Gz-Da for qemu-devel@nongnu.org; Wed, 25 Jun 2014 08:26:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzmHF-0001Go-5i for qemu-devel@nongnu.org; Wed, 25 Jun 2014 08:26:13 -0400 From: Paolo Bonzini Date: Wed, 25 Jun 2014 14:25:49 +0200 Message-Id: <1403699158-4344-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1403699158-4344-1-git-send-email-pbonzini@redhat.com> References: <1403699158-4344-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH for 2.1 05/14] qom: object: remove parent pointer when unparenting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite From: Peter Crosthwaite 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 --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index 4d1c999..a3b8cf3 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); } -- 1.8.3.1