From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsJ9k-00045M-4z for qemu-devel@nongnu.org; Sun, 15 Dec 2013 16:23:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsJ9e-0004IE-22 for qemu-devel@nongnu.org; Sun, 15 Dec 2013 16:23:20 -0500 Received: from cantor2.suse.de ([195.135.220.15]:54118 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsJ9d-0004I8-Rb for qemu-devel@nongnu.org; Sun, 15 Dec 2013 16:23:13 -0500 Message-ID: <52AE1DBB.9080605@suse.de> Date: Sun, 15 Dec 2013 22:23:07 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1386085320-12965-1-git-send-email-pbonzini@redhat.com> <1386085320-12965-3-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Peter Crosthwaite , Paolo Bonzini , Alexey Kardashevskiy , Igor Mammedov Cc: =?ISO-8859-1?Q?Herv=E9_Poussineau?= , "qemu-devel@nongnu.org Developers" Am 04.12.2013 06:51, schrieb Peter Crosthwaite: > On Wed, Dec 4, 2013 at 1:42 AM, Paolo Bonzini wro= te: >> From: Herv=E9 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=E9 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 =3D false; >=20 > 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!). I also took the liberty of inserted a white line to make the function better readable. 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