Received: from eggs.gnu.org ([2001:4830:134:3::10]:49184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtbw0-0003tR-4t for qemu-devel@nongnu.org; Thu, 19 Dec 2013 06:38:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vtbvs-0007Xm-0H for qemu-devel@nongnu.org; Thu, 19 Dec 2013 06:38:32 -0500 Received: from mail-pb0-f53.google.com ([209.85.160.53]:61119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtbvr-0007XV-Qy for qemu-devel@nongnu.org; Thu, 19 Dec 2013 06:38:23 -0500 Received: by mail-pb0-f53.google.com with SMTP id ma3so1034995pbc.26 for ; Thu, 19 Dec 2013 03:38:22 -0800 (PST) Message-ID: <52B2DAA6.5050806@ozlabs.ru> Date: Thu, 19 Dec 2013 22:38:14 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1386085320-12965-1-git-send-email-pbonzini@redhat.com> <1386085320-12965-3-git-send-email-pbonzini@redhat.com> <52AE1DBB.9080605@suse.de> In-Reply-To: <52AE1DBB.9080605@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/2] qom: detect bad reentrance during object_class_foreach List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Peter Crosthwaite , Paolo Bonzini , Igor Mammedov Cc: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= , "qemu-devel@nongnu.org Developers" On 12/16/2013 08:23 AM, Andreas Färber wrote: > Am 04.12.2013 06:51, schrieb Peter Crosthwaite: >> On Wed, Dec 4, 2013 at 1:42 AM, Paolo Bonzini wrote: >>> From: Hervé Poussineau >>> >>> We should not modify the type hash table while it is being iterated on. >>> Assert that it does not happen. >>> >>> Signed-off-by: Hervé Poussineau >>> Signed-off-by: Paolo Bonzini >>> --- >>> qom/object.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/qom/object.c b/qom/object.c >>> index 3a43186..1dee9f0 100644 >>> --- a/qom/object.c >>> +++ b/qom/object.c >>> @@ -78,8 +78,10 @@ static GHashTable *type_table_get(void) >>> return type_table; >>> } >>> >>> +static bool enumerating = false; >> >> Global variable could probably use a more descriptive name. > > I renamed it to enumerating_types and dropped the assignment as > suggested elsewhere by Alexey (a reply here would've been nice!). Whose reply? To what? :) > > I also took the liberty of inserted a white line to make the function > better readable. I do not mind, this was not my stuff :) What I wonder about is what is going to happen to the rest of what I posted? Should I wait till this qom-next gets merged to upstream and repost my patches for Alex Graf again? Thanks. -- Alexey