From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIedh-0004o6-CO for qemu-devel@nongnu.org; Thu, 21 Mar 2013 08:30:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIedb-00076o-77 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 08:30:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIeda-00076e-VV for qemu-devel@nongnu.org; Thu, 21 Mar 2013 08:30:31 -0400 Date: Thu, 21 Mar 2013 14:30:44 +0200 From: "Michael S. Tsirkin" Message-ID: <20130321123044.GA32484@redhat.com> References: <514AFC4E.4070804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <514AFC4E.4070804@redhat.com> Subject: Re: [Qemu-devel] [PATCH v9 2/3] qom: call class destructor before unparent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Anthony Liguori , Eduardo Habkost , libvir-list@redhat.com, Stefan Hajnoczi , Markus Armbruster , qemu-devel@nongnu.org, Gerd Hoffmann , Luiz Capitulino , afaerber@suse.de On Thu, Mar 21, 2013 at 01:25:50PM +0100, Paolo Bonzini wrote: > Il 21/03/2013 13:07, Michael S. Tsirkin ha scritto: > > Make sure object is valid when destructor is called. > > "Make sure the object still has a canonical path while the unparent > callback is running". > > Otherwise, the series looks good. > > Paolo Worth respinning for? > > Signed-off-by: Michael S. Tsirkin > > --- > > qom/object.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/qom/object.c b/qom/object.c > > index 3d638ff..a0e3cbe 100644 > > --- a/qom/object.c > > +++ b/qom/object.c > > @@ -363,12 +363,12 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp) > > void object_unparent(Object *obj) > > { > > object_ref(obj); > > - if (obj->parent) { > > - object_property_del_child(obj->parent, obj, NULL); > > - } > > if (obj->class->unparent) { > > (obj->class->unparent)(obj); > > } > > + if (obj->parent) { > > + object_property_del_child(obj->parent, obj, NULL); > > + } > > object_unref(obj); > > } > > > >