From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wuder-0002i5-OK for qemu-devel@nongnu.org; Wed, 11 Jun 2014 04:13:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wudel-0005CX-Gg for qemu-devel@nongnu.org; Wed, 11 Jun 2014 04:13:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60648 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wudel-0005CK-9y for qemu-devel@nongnu.org; Wed, 11 Jun 2014 04:13:15 -0400 Message-ID: <53980F98.9090000@suse.de> Date: Wed, 11 Jun 2014 10:13:12 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <97a5753d0e2e5d8ce43730fb0d8595ceb69261a9.1401151094.git.peter.crosthwaite@xilinx.com> In-Reply-To: <97a5753d0e2e5d8ce43730fb0d8595ceb69261a9.1401151094.git.peter.crosthwaite@xilinx.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom v1 1/1] qom: object: remove parent pointer when unparenting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi Am 27.05.2014 02:39, schrieb 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. >=20 > Signed-off-by: Peter Crosthwaite > --- >=20 > qom/object.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/qom/object.c b/qom/object.c > index e42b254..8319e89 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 =3D NULL; > object_unref(obj); > } > =20 This looks okay to me, and it might also help the segfault on hot-unplug Stefan and Kevin reported before I went on travels. Any objection to moving this one line up into the if? Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg