From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRPs6-0002Sj-CS for qemu-devel@nongnu.org; Mon, 17 Aug 2015 15:15:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRPs1-0003P0-Ob for qemu-devel@nongnu.org; Mon, 17 Aug 2015 15:15:02 -0400 Received: from resqmta-po-02v.sys.comcast.net ([96.114.154.161]:48728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRPs1-0003Ot-II for qemu-devel@nongnu.org; Mon, 17 Aug 2015 15:14:57 -0400 References: <1438679896-5077-1-git-send-email-armbru@redhat.com> <1438679896-5077-21-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55D232AB.2080004@redhat.com> Date: Mon, 17 Aug 2015 12:14:51 -0700 MIME-Version: 1.0 In-Reply-To: <1438679896-5077-21-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k6HEPgGi5xpNix1xpL0B7kVm4E1B97dK3" Subject: Re: [Qemu-devel] [PATCH 20/26] qapi: Fix to reject union command and event arguments 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) --k6HEPgGi5xpNix1xpL0B7kVm4E1B97dK3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/04/2015 02:18 AM, Markus Armbruster wrote: > A command's or event's 'data' must be a struct type, given either as a > dictionary, or as struct type name. >=20 > Commit dd883c6 tightened the checking there, but not enough: we still > accept 'union'. Fix to reject it. >=20 > We may want to support union types there, but we'll have to extend > qapi-commands.py and qapi-events.py for it. >=20 > Signed-off-by: Markus Armbruster > --- > scripts/qapi.py | 4 ++-- > tests/qapi-schema/args-union.err | 1 + > tests/qapi-schema/args-union.exit | 2 +- > tests/qapi-schema/args-union.json | 2 +- > tests/qapi-schema/args-union.out | 4 ---- > 5 files changed, 5 insertions(+), 8 deletions(-) Our documentation is also wrong; you may want to squash this in: diff --git i/docs/qapi-code-gen.txt w/docs/qapi-code-gen.txt index 688a60c..4652a75 100644 --- i/docs/qapi-code-gen.txt +++ w/docs/qapi-code-gen.txt @@ -408,10 +408,9 @@ Client JSON Protocol command exchange. The 'data' argument maps to the "arguments" dictionary passed in as part of a Client JSON Protocol command. The 'data' member is optional and defaults to {} (an empty dictionary). If present, it must be the -string name of a complex type, a one-element array containing the name -of a complex type, or a dictionary that declares an anonymous type -with the same semantics as a 'struct' expression, with one exception -noted below when 'gen' is used. +string name of a complex type, or a dictionary that declares an +anonymous type with the same semantics as a 'struct' expression, with +one exception noted below when 'gen' is used. The 'returns' member describes what will appear in the "return" field of a Client JSON Protocol reply on successful completion of a command. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --k6HEPgGi5xpNix1xpL0B7kVm4E1B97dK3 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/ iQEcBAEBCAAGBQJV0jKrAAoJEKeha0olJ0NqBqgH+gKmI1yLJTlKcHCxoNfP6Xwb UfM9XGY5SkYyop208OutWMXHIbtHrDL6vR2ETi+UQO5d2/G1UJeRb2u4gS8ryrDR QleYI79Bf7WDGKxqbkbIItnyRxrkBf0F4gZO8sXb+xEJB7X8TVslX6W8kmfKcvAk 4Mbh6IoiJCd9Qf1VOd4JBUyyrxz/5aE8jPSj4zfYZ7TKfC8D9PU9fdDRN8SQF3Pk abmzvU9uWOZQf3gfk9eEVfrfUTM0n2GPkSKOJbARIWIu+nPTbv18Mhl59qzOJr10 GVr58xDUuSckSYzZFTkcfQUA+u0WGTXxem6obw0rzai1S+nqBLT2XDgDpCjnAb8= =0aWZ -----END PGP SIGNATURE----- --k6HEPgGi5xpNix1xpL0B7kVm4E1B97dK3--