Received: from eggs.gnu.org ([2001:4830:134:3::10]:33393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb4TI-0003Mh-K9 for qemu-devel@nongnu.org; Thu, 26 Mar 2015 05:53:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yb4TD-0001xJ-Sn for qemu-devel@nongnu.org; Thu, 26 Mar 2015 05:53:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb4TD-0001xE-Ju for qemu-devel@nongnu.org; Thu, 26 Mar 2015 05:52:59 -0400 From: Markus Armbruster References: <1427227433-5030-1-git-send-email-eblake@redhat.com> <1427227433-5030-3-git-send-email-eblake@redhat.com> Date: Thu, 26 Mar 2015 10:52:54 +0100 In-Reply-To: <1427227433-5030-3-git-send-email-eblake@redhat.com> (Eric Blake's message of "Tue, 24 Mar 2015 14:03:27 -0600") Message-ID: <87h9t86q6h.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v5 02/28] qapi: Fix generation of 'size' builtin type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, lcapitulino@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, wenchaoqemu@gmail.com Eric Blake writes: > We were missing the 'size' builtin type (which means that QAPI using > [ 'size' ] would fail to compile). I suspect it chokes on 'size' in anonymous unions, too. > Futhermore, there was some > redundancy between builtin_types[] and builtin_type_qtypes{}. > > Signed-off-by: Eric Blake Split off "[PATCH v4 10/19] qapi: Better error messages for duplicated expressions". Good. > --- > scripts/qapi-types.py | 10 +++++----- > scripts/qapi-visit.py | 6 +++--- > scripts/qapi.py | 9 ++------- > tests/qapi-schema/qapi-schema-test.json | 3 ++- > tests/qapi-schema/qapi-schema-test.out | 2 +- > 5 files changed, 13 insertions(+), 17 deletions(-) > > diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py > index db87218..e400b03 100644 > --- a/scripts/qapi-types.py > +++ b/scripts/qapi-types.py > @@ -182,8 +182,8 @@ const int %(name)s_qtypes[QTYPE_MAX] = { > > for key in members: > qapi_type = members[key] > - if builtin_type_qtypes.has_key(qapi_type): > - qtype = builtin_type_qtypes[qapi_type] > + if builtin_types.has_key(qapi_type): > + qtype = builtin_types[qapi_type] > elif find_struct(qapi_type): > qtype = "QTYPE_QDICT" > elif find_union(qapi_type): Took me a bit of digging to make the connection to "there was some redundancy between builtin_types[] and builtin_type_qtypes{}", and to the patch to qapi.py. You could split this patch up: one part for folding _qtypes into _types, and another part for fixing 'size'. Not worth a respin by itself, so: Reviewed-by: Markus Armbruster [...]