From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXhJV-0005u6-KD for qemu-devel@nongnu.org; Thu, 03 Sep 2015 23:05:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXhJS-0005FP-Du for qemu-devel@nongnu.org; Thu, 03 Sep 2015 23:05:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXhJR-0005EN-TM for qemu-devel@nongnu.org; Thu, 03 Sep 2015 23:05:14 -0400 References: <1441290623-13631-1-git-send-email-armbru@redhat.com> <1441290623-13631-3-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55E90A62.6010200@redhat.com> Date: Thu, 3 Sep 2015 21:05:06 -0600 MIME-Version: 1.0 In-Reply-To: <1441290623-13631-3-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K2ECPCBJ8m9FLwJxk6iNAilLBwdKOqB2d" Subject: Re: [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --K2ECPCBJ8m9FLwJxk6iNAilLBwdKOqB2d Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/03/2015 08:29 AM, Markus Armbruster wrote: > The QAPI code generators work with a syntax tree (nested dictionaries) > plus a few symbol tables (also dictionaries) on the side. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > +class QAPISchemaObjectTypeVariants(object): > + def __init__(self, tag_name, tag_enum, variants): > + assert tag_name =3D=3D None or isinstance(tag_name, str) > + assert tag_enum =3D=3D None or isinstance(tag_enum, str) > + for v in variants: > + assert isinstance(v, QAPISchemaObjectTypeVariant) > + self.tag_name =3D tag_name > + if tag_name: > + assert not tag_enum > + self.tag_member =3D None > + else: > + self.tag_member =3D QAPISchemaObjectTypeMember('kind', tag= _enum, > + False) See my review on 30/32. Introspection-wise, we want this generated member to be named 'type' to match what is on the wire. This patch, plus two more to qapi-types.py and qapi-visit.py, are sufficient to make no changes to the other generated files, while fixing the bug in qmp-introspect.c: diff --git i/scripts/qapi.py w/scripts/qapi.py index d2b6964..b2643af 100644 --- i/scripts/qapi.py +++ w/scripts/qapi.py @@ -928,7 +928,7 @@ class QAPISchemaObjectTypeVariants(object): assert not tag_enum self.tag_member =3D None else: - self.tag_member =3D QAPISchemaObjectTypeMember('kind', tag_e= num, + self.tag_member =3D QAPISchemaObjectTypeMember('type', tag_e= num, False) self.variants =3D variants def check(self, schema, members, seen): --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --K2ECPCBJ8m9FLwJxk6iNAilLBwdKOqB2d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6QpiAAoJEKeha0olJ0NqUFkH/R55Nhg/Dovgtk2q/kwEwPFW odNClGXDKhBCLx/pTuHjR6Lb+h+h++oG+FEprYww38KSx7BGHNUgsIcPbHO5CNMi WxaO7ov/+ZxsL/MLnta0bcxzRwHHCpFzEi8HQohoqEiiB65MnQ/iQb+avA4irCGL SP8uLtgQR+qCp/8rksg38SYMl5MnTN+U3E4aWqv48PFnNy7hmFGoJjIvMmP4+1Fc W66Ff+ywpeWUZjgyftrQBUGDtNf5pPaTPUAT3UCSsAOEMJ2Em68x//r/mDt78E2x iXdh8MWQ9RhcFZTLdPZxj69+WW2l2e0SGamzS2Y82hcTS2XvHcQEc13DGupLMHY= =Vnst -----END PGP SIGNATURE----- --K2ECPCBJ8m9FLwJxk6iNAilLBwdKOqB2d--