From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XX9bA-0006hu-UL for qemu-devel@nongnu.org; Thu, 25 Sep 2014 10:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XX9b3-00056j-0Y for qemu-devel@nongnu.org; Thu, 25 Sep 2014 10:00:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XX9b2-00055I-NO for qemu-devel@nongnu.org; Thu, 25 Sep 2014 10:00:36 -0400 Message-ID: <54241FFB.2000104@redhat.com> Date: Thu, 25 Sep 2014 08:00:27 -0600 From: Eric Blake MIME-Version: 1.0 References: <1411165504-18198-1-git-send-email-eblake@redhat.com> <1411165504-18198-13-git-send-email-eblake@redhat.com> <87h9zw9mqy.fsf@blackfin.pond.sub.org> <87y4t85dlc.fsf@blackfin.pond.sub.org> In-Reply-To: <87y4t85dlc.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0jDXMCLPt5pK2ji5dbX3MAFUhXRb6m2Ft" Subject: Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Fam Zheng , qemu-devel@nongnu.org, wenchaoqemu@gmail.com, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0jDXMCLPt5pK2ji5dbX3MAFUhXRb6m2Ft Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/25/2014 02:06 AM, Markus Armbruster wrote: >> >> The QAPI schema's 'returns' becomes "return" on the wire. We suck. >> >> qmp-spec.txt is *wrong*! We actually use json-array in addition to >> json-object. >=20 > Actually, we use json-int and json-str as well: > query-migrate-cache-size, ringbuf-read, human-monitor-command. >=20 >> Similar argument on types wanted as for 'data' / "arguments" above. I= >> think we should permit exactly the same QAPI types, plus lists. >=20 > The similarity to 'data' just isn't there. Separate analysis needed. Correct. 'data' and 'returns' are different beasts when it comes to acceptable types. And different still from the acceptable type of each member of a dictionary. But my check_type function in 13/19 is flexible enough to cover all the cases. >=20 > Any QAPI types that don't make sense, other than list with length !=3D = 1? Return of an anon union isn't used yet, but _might_ make sense (as the only feasible way of changing existing commands that return an array or primitive extensible to instead return a dict) - except that back-compat demands that we can't return a dict in place of a primitive unless the arguments of the command are also enhanced (that is, older callers are not expecting a dict, so we can't return a dict unless the caller witnesses they are new enough by explicitly asking for a dict return). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0jDXMCLPt5pK2ji5dbX3MAFUhXRb6m2Ft 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUJB/7AAoJEKeha0olJ0Nq75UIAKB1xzSCJM06bb75LWdtPxTb hm27+wykPbtK9RF2ETvn78qaawZQVNYSVpfXNDXthElr06t3UjltsiVYleWTdpvV 4Vhs6qWtSCCHuV4HCmDufokxntXcwZF1MOqOUcPyP+EDmOWIqFqFctRhks4zcznp PL2B/ebnmBYo92TCIwCdGVROv/PFuGiKjKgQ8euUyMW8Th/tmX8pupMPk9g1SffC QN74483N+vMXvKKUKHjYs3BFGaCFR7YVtWRBbE4rhrzq8Jk/zNsk2hg8ukvQLzB+ 3F5lEIVA2ktq63MtCkfOfOn04YJGIJ70vUi4wp9k6CkzlXCwdSqYGn1ovXrJVfI= =jQe0 -----END PGP SIGNATURE----- --0jDXMCLPt5pK2ji5dbX3MAFUhXRb6m2Ft--