From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxFVF-0002v0-Jn for qemu-devel@nongnu.org; Thu, 11 Jul 2013 07:57:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxFVE-0007CU-Gu for qemu-devel@nongnu.org; Thu, 11 Jul 2013 07:57:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxFVE-0007CG-8s for qemu-devel@nongnu.org; Thu, 11 Jul 2013 07:57:40 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6BBvcQb032029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Jul 2013 07:57:39 -0400 Message-ID: <51DE9DB1.90801@redhat.com> Date: Thu, 11 Jul 2013 05:57:37 -0600 From: Eric Blake MIME-Version: 1.0 References: <1373363617-4723-1-git-send-email-kwolf@redhat.com> <1373363617-4723-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1373363617-4723-3-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2TEOJFNJCDJGATSLQUBQA" Subject: Re: [Qemu-devel] [RFC PATCH 02/11] qapi-types.py: Implement 'base' for unions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: armbru@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TEOJFNJCDJGATSLQUBQA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/09/2013 03:53 AM, Kevin Wolf wrote: > The new 'base' key in a union definition refers to a struct type, which= > is inlined into the union definition and can represent fields common to= > all kinds. Is it worth listing an example of intended use in the commit message? If I understand correctly, then this qapi-schema.json file: { 'type': 'Base', 'data': { 'main': 'str' } } { 'type': 'Extra1', 'data': { 'foo': 'str' } } { 'type': 'Extra2', 'data': { 'bar': 'str' } } { 'union': 'Type', 'base': 'BaseType', 'data': { 'variant1': 'Extra1', 'variant2': 'Extra2' } } { 'command': 'test', 'data': { 'arg': 'Type' } } would then be used over the wire as: { "execute": "test", "arguments": { "arg": { "type": "variant1", "data": { "main": "hello", "foo": "world" } } } } { "execute": "test", "arguments": { "arg": { "type": "variant2", "data": { "main": "hi", "bar": "there" } } } } >=20 > Signed-off-by: Kevin Wolf > --- > scripts/qapi-types.py | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) I'm slowly learning python, so my review skills are still weak the more complicated the changes are; but this seems easy enough to understand. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2TEOJFNJCDJGATSLQUBQA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR3p2xAAoJEKeha0olJ0NqwMIIAJNkMQ2sSWczXPSPnGIN35kn 4xXh7UZ9SVKTNffmTbOyNht61wTwJT4j6ppj0y8jP0C6UPkJUxRl5Ed7CkScgmFm n/VrymJEutkf/mAUEComO4oNJZ0OzJA4QByka5REF1RPAkACJ+OGg16GY34zOMSK wgDoX4LDc1rYoowMyXujA91oTHspUNc8paFqHtlWn2IKJZx/5y4A9zIsqrTYD1mZ XXKNuFX63wBos5VafypJyxsT+ggk20mi7qN1oADN/7/dh6LV9YK+IkK6SLiCUVH7 Gh09NMCqhvwxfFL29WjztCEnrJFaw1ZZD5PXvLV3qiD8cqIMm3VeHApzLX2s0e0= =VID4 -----END PGP SIGNATURE----- ------enig2TEOJFNJCDJGATSLQUBQA--