From patchwork Tue Jul 1 08:34:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 365906 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 51F2614008C for ; Tue, 1 Jul 2014 18:37:44 +1000 (EST) Received: from localhost ([::1]:39466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tZO-0005fS-Dt for incoming@patchwork.ozlabs.org; Tue, 01 Jul 2014 04:37:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tXJ-0002JC-83 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:35:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1tXD-0000rT-2T for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:35:33 -0400 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:40424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tXC-0000rI-IF for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:35:26 -0400 Received: by mail-we0-f178.google.com with SMTP id x48so9214586wes.9 for ; Tue, 01 Jul 2014 01:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=h5nLFzSM1GU2Mxe5+01SNQQ2Bx9P9d3by+WX2YBNhh0=; b=B5uQgr/PQ876NKAjj8RttkkdO1JOwtGf3XuZFObVa34Le5oKJIjWJvvmQNq2F94gv5 xoJEXcOUuUtey1STqylkNyS+q0mzgYHqD2sBNqnapJW34tUJtZBNHqX1gOAKOJlTz/3P EGEQTxxna75IAT4kQAWg42Wnnr3aNdwRPi58zdsbqV2U9BZySlJ8AJ/RepAtj4JfvoNR N+faRWQVGNICYKKNlDSgZ4HbzGQnNfyya/+uo1xpWij0+Ub9MICMts/TozwvLWWxuiAA MByZK9ek7GAKy8RPjYxiP7uh3h0jhygTX01i+SUQwLe5bNWwnVlCZu8yQqq/jZHlB3uS lTNA== X-Received: by 10.180.212.73 with SMTP id ni9mr34310277wic.59.1404203725771; Tue, 01 Jul 2014 01:35:25 -0700 (PDT) Received: from playground.station (net-37-116-207-238.cust.vodafonedsl.it. [37.116.207.238]) by mx.google.com with ESMTPSA id dj2sm40758365wib.11.2014.07.01.01.35.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jul 2014 01:35:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 1 Jul 2014 10:34:55 +0200 Message-Id: <1404203705-15674-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1404203705-15674-1-git-send-email-pbonzini@redhat.com> References: <1404203705-15674-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::232 Cc: Peter Crosthwaite Subject: [Qemu-devel] [PULL 05/15] qom: object: 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: Paolo Bonzini --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index f49335f..d5de8f6 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); }