From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJnyL-0006mv-K6 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 15:22:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJnyK-00030J-H0 for qemu-devel@nongnu.org; Mon, 27 Jul 2015 15:22:01 -0400 References: <1438018255-23734-1-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <55B684D0.6090308@redhat.com> Date: Mon, 27 Jul 2015 13:21:52 -0600 MIME-Version: 1.0 In-Reply-To: <1438018255-23734-1-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FAag8ea9grASbbOfGLqP4MN3DgtgR5F7B" Subject: Re: [Qemu-devel] [PATCH] qapi: use 'type' in generated C code to match QMP union wire form List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Eduardo Habkost , "open list:qcow2" , "Michael S. Tsirkin" , Jason Wang , mdroth@linux.vnet.ibm.com, armbru@redhat.com, Gerd Hoffmann , Stefan Hajnoczi , Igor Mammedov , Paolo Bonzini , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FAag8ea9grASbbOfGLqP4MN3DgtgR5F7B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/27/2015 11:30 AM, Eric Blake wrote: > When dealing with simple qapi unions, the code was generating a > discriminator field of 'kind' even though the discriminator is > sent as 'type' over QMP. Renaming things to match gets us one > step closer to reusing common generator code for both simple and > flat unions, without having to special case the naming choice > for simple unions. >=20 > However, this patch does not rename the generated enum, which is > still 'unionnameKind'; if we wanted, a further patch could > generate implicit enums as 'unionnameType', with even more > churn to C code to react, and probably update the qapi generator > to reserve the 'fooType' namespace instead of 'fooKind'. But > that is a lot harder, as we already have existing qapi usage > of types that end in 'Type'. >=20 > Signed-off-by: Eric Blake > --- >=20 > Applies on top of Markus' "[PATCH RFC v2 00/47] qapi: QMP > introspection". Making this cleanup would make it easier > to switch between simple and flat unions in the future as > needed, because the C code would always use the discriminator > name passed over QMP. And missing changes to tests/test-qmp-* that prevent 'make check-qapi-schema check-unit' from passing. But I'll wait to send a v2 until after Markus' series is reposted, as there may be some rebasing required. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --FAag8ea9grASbbOfGLqP4MN3DgtgR5F7B 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/ iQEcBAEBCAAGBQJVtoTRAAoJEKeha0olJ0Nqbp4H/3ctD5y+14LFzojZCcFs2VKt SYjfYpbdHmRRVHK7tiyxTU/w4GJu57xmTnnLtNN8yl/U/FG72whtkiVb0rzBxl4J 8U1LbviaaquOj61M88Bv7ShpQ/yPI0IVMr0cjbwsVHODlvVbN9VrZ/hf/RA9RyFz zvGVKeKEnH/Asz97oaXfh+3btMFvIB+8iqCuh3TWsjXxuUHwhUFNzQ7O2AVkh2DY upLul04QbrGf3CKHgiJEDqYfnQscKls+1gkpJ2OOfK5jGfcIG4aAtvCdFbYc/fg0 lRwBabD370rDzkmFoQ1+qc8XB/fE4kw1NOHEMSDFm8PtWiMrytlcELl9z2yVaiM= =Swh2 -----END PGP SIGNATURE----- --FAag8ea9grASbbOfGLqP4MN3DgtgR5F7B--