From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu0ND-000295-Su for qemu-devel@nongnu.org; Wed, 04 Nov 2015 10:53:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zu0N8-00036p-SX for qemu-devel@nongnu.org; Wed, 04 Nov 2015 10:53:19 -0500 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:33329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu0N8-00036l-Mi for qemu-devel@nongnu.org; Wed, 04 Nov 2015 10:53:14 -0500 Received: by wmeg8 with SMTP id g8so114221657wme.0 for ; Wed, 04 Nov 2015 07:53:14 -0800 (PST) Sender: Paolo Bonzini References: <1445253099-16894-1-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <563A29E7.4030808@redhat.com> Date: Wed, 4 Nov 2015 16:53:11 +0100 MIME-Version: 1.0 In-Reply-To: <1445253099-16894-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qdev: free qemu-opts when the QOM path goes away List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: afaerber@suse.de On 19/10/2015 13:11, Paolo Bonzini wrote: > Otherwise there is a race where the DEVICE_DELETED event has been sent but > attempts to reuse the ID will fail. > > Reported-by: Michael S. Tsirkin > Signed-off-by: Paolo Bonzini Ping? Paolo > --- > hw/core/qdev.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/core/qdev.c b/hw/core/qdev.c > index 4ab04aa..92bd8bb 100644 > --- a/hw/core/qdev.c > +++ b/hw/core/qdev.c > @@ -1203,7 +1203,6 @@ static void device_finalize(Object *obj) > NamedGPIOList *ngl, *next; > > DeviceState *dev = DEVICE(obj); > - qemu_opts_del(dev->opts); > > QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) { > QLIST_REMOVE(ngl, node); > @@ -1251,6 +1250,9 @@ static void device_unparent(Object *obj) > qapi_event_send_device_deleted(!!dev->id, dev->id, path, &error_abort); > g_free(path); > } > + > + qemu_opts_del(dev->opts); > + dev->opts = NULL; > } > > static void device_class_init(ObjectClass *class, void *data) >