From patchwork Tue Jul 1 03:08:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 365858 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6A44F1400B7 for ; Tue, 1 Jul 2014 13:09:06 +1000 (EST) Received: from localhost ([::1]:38007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1oRM-0005Z7-Hq for incoming@patchwork.ozlabs.org; Mon, 30 Jun 2014 23:09:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1oQl-0004du-1I for qemu-devel@nongnu.org; Mon, 30 Jun 2014 23:08:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1oQf-0003nH-IY for qemu-devel@nongnu.org; Mon, 30 Jun 2014 23:08:26 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34496 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1oQf-0003mj-Bc for qemu-devel@nongnu.org; Mon, 30 Jun 2014 23:08:21 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1B32CAB13; Tue, 1 Jul 2014 03:08:19 +0000 (UTC) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 1 Jul 2014 05:08:09 +0200 Message-Id: <1404184093-966-2-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1404184093-966-1-git-send-email-afaerber@suse.de> References: <1404184093-966-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori Subject: [Qemu-devel] [PULL 1/5] qom: Remove parent pointer when unparenting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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: Andreas Färber --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index 3876618..7cefdf2 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); }