From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwt0S-0007Jb-1n for qemu-devel@nongnu.org; Mon, 13 Feb 2012 05:19:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rwt0M-0007qv-6N for qemu-devel@nongnu.org; Mon, 13 Feb 2012 05:19:35 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:62470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwt0L-0007qn-V0 for qemu-devel@nongnu.org; Mon, 13 Feb 2012 05:19:30 -0500 Received: by pbbro12 with SMTP id ro12so5135977pbb.4 for ; Mon, 13 Feb 2012 02:19:28 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F38E3AA.5020408@redhat.com> Date: Mon, 13 Feb 2012 11:19:22 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20120212170743.GA3375@redhat.com> <20120212173140.GB3375@redhat.com> <4F37F910.5030400@codemonkey.ws> <20120212175659.GA4199@redhat.com> <4F381B4D.2000108@codemonkey.ws> <20120212201547.GC4199@redhat.com> <4F381EC7.3030407@codemonkey.ws> <20120213001735.GA8269@redhat.com> <20120213011813.GA8482@redhat.com> <20120213045807.GA22676@redhat.com> In-Reply-To: <20120213045807.GA22676@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] weird qdev error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On 02/13/2012 05:58 AM, Michael S. Tsirkin wrote: > Doesn't solve this issue, but shouldn't we use _SAFE > in object_property_del_child? Like this: > > ---> > qemu: use safe list macro > > As we might remove an element from list, use the safe macro > to walk it. > > Signed-off-by: Michael S. Tsirkin > > --- > > diff --git a/qom/object.c b/qom/object.c > index 5e5b261..8b64fb6 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -299,9 +299,9 @@ static void object_property_del_all(Object *obj) > > static void object_property_del_child(Object *obj, Object *child, Error **errp) > { > - ObjectProperty *prop; > + ObjectProperty *prop, *next; > > - QTAILQ_FOREACH(prop, &obj->properties, node) { > + QTAILQ_FOREACH_SAFE(prop, &obj->properties, node, next) { > if (!strstart(prop->type, "child<", NULL)) { > continue; > } Yup, I thought I had pointed this out in a review of Anthony's QOM series... Reviewed-by: Paolo Bonzini Paolo