Received: from eggs.gnu.org ([2001:4830:134:3::10]:48679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuhVP-000857-NL for qemu-devel@nongnu.org; Wed, 11 Jun 2014 08:19:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuhVJ-0001QU-PJ for qemu-devel@nongnu.org; Wed, 11 Jun 2014 08:19:51 -0400 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:55488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuhVJ-0001QK-J0 for qemu-devel@nongnu.org; Wed, 11 Jun 2014 08:19:45 -0400 Received: by mail-we0-f182.google.com with SMTP id q59so3655361wes.41 for ; Wed, 11 Jun 2014 05:19:44 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 11 Jun 2014 14:19:25 +0200 Message-Id: <1402489176-19738-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1402489176-19738-1-git-send-email-pbonzini@redhat.com> References: <1402489176-19738-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [RFC PATCH 02/13] 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@xilinx.com, afaerber@suse.de 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 3650a5b..01087e5 100644 --- a/qom/object.c +++ b/qom/object.c @@ -396,6 +396,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