From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEfRm-0005V0-IV for qemu-devel@nongnu.org; Mon, 02 Apr 2012 07:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEfRg-0003Uj-DH for qemu-devel@nongnu.org; Mon, 02 Apr 2012 07:29:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEfRg-0003Ue-5G for qemu-devel@nongnu.org; Mon, 02 Apr 2012 07:29:12 -0400 Message-ID: <4F798D75.8050009@redhat.com> Date: Mon, 02 Apr 2012 13:28:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1332417072-20329-1-git-send-email-pbonzini@redhat.com> <1332417072-20329-9-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/10] qapi: add strict mode to input visitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Desnogues Cc: anthony@codemonkey.vs, lcapitulino@redhat.com, eblake@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Il 02/04/2012 12:34, Laurent Desnogues ha scritto: >> > static void qmp_input_pop(QmpInputVisitor *qiv, Error **errp) >> > { >> > + GHashTableIter iter; > GHashTableIter is alas not available in the glib (2.12) that > the distros we use at work run. Is there a workaround for > this issue? Yeah, since the hash table is going to be destroyed anyway, and will always be empty in the common case, you can call g_hash_table_foreach_remove, and raise an error if it returns > 0 Something like gboolean hash_table_empty_check(gpointer key, gpointer value, gpointer user_data) { gpointer *p_key = user_data; if (!*p_key) { *p_key = key; } return true; } .... key = NULL; if (g_hash_table_foreach_remove(qiv->stack[qiv->nb_stack - 1].h, hash_table_empty_check, &key) { error_set(errp, QERR_QMP_EXTRA_MEMBER, (char *) key); } g_hash_table_unref(qiv->stack[qiv->nb_stack - 1].h); Can you make a patch? Paolo