From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uu3bz-0008GX-Ou for qemu-devel@nongnu.org; Tue, 02 Jul 2013 12:39:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uu3bu-0008Gk-9B for qemu-devel@nongnu.org; Tue, 02 Jul 2013 12:39:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uu3bt-0008Ge-W7 for qemu-devel@nongnu.org; Tue, 02 Jul 2013 12:39:22 -0400 Message-ID: <51D30231.5070705@redhat.com> Date: Tue, 02 Jul 2013 10:39:13 -0600 From: Eric Blake MIME-Version: 1.0 References: <1371644677-11041-1-git-send-email-akong@redhat.com> <20130619124914.GA11095@amosk.info> In-Reply-To: <20130619124914.GA11095@amosk.info> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2DHOWRXVIVEQPVTLMFMMS" Subject: Re: [Qemu-devel] [PATCH] full introspection support for QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com, qiaonuohan@cn.fujitsu.com, pbonzini@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DHOWRXVIVEQPVTLMFMMS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/19/2013 06:49 AM, Amos Kong wrote: > On Wed, Jun 19, 2013 at 08:24:37PM +0800, Amos Kong wrote: >> Introduces new monitor command to query QMP schema information, >> the return data is a nested dict/list, it contains the useful >> metadata. >> >> we can add events definations to qapi-schema.json, then it can >> also be queried. > =20 > I didn't implement to return complete schema in one go in this > version, will do it in next version. We have a recursive define > 'DataObject', we only display one layer for it. Yes, for recursive definitions, we have to stop somewhere. >=20 > You can find three kind of examples(string/list/dict) in the bottom. > Attached (query-qmp-schema--output.txt) the full output of execut query= -qmp-schema command. >=20 > String: > { 'command': 'query-name', 'returns': 'NameInfo' } > --------------------------------------------------------------------- > { > "name": "NameInfo", > "type": "Type", > "data": [ > { > "name": "*name", > "type": "str" > } > ] > }, This output still requires post-processing - the user has to parse the key "*name" to learn two bits of information - whether the parameter is optional, and the fact that it is named "name" not "*name". I _still_ argue that we want to return 3 things, not two, as in: "data": [ { "name": "name", "optional": true, "type": "str" } ] --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2DHOWRXVIVEQPVTLMFMMS 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/ iQEcBAEBCAAGBQJR0wIxAAoJEKeha0olJ0Nqr7sH/0yZQMG1O/Bj3/DwXwUcva/p +HPYebtGbHUxn4Wjf0NEKklG6w8d3Ln/3qpy0JTy36gaBtN6JC3OlvR5vM4zvdOk B8KgKmGn6+imGwIXb5UjCMH1EL7lAD+BlBdOjQMOPBIHEsQPX70V8wc1xuH9nq9z pqDE/JcWay8X6Oo64J9YU0Six5PfOvGy+z/+jqxHAKzd9bdpnulg0GYNkOKdZHKg VztI8SahKKv2Qw3Uwf5VHzm/lpMTOLhCxZW6av94PGPxL0JRLEUe6k03R8wnyU8L GFgWQfTw7m5ZfLceYVE6EEw/m2zRhIMrUXqN0OkBYqTeOI7ubPX2CPF1Gi8audk= =j7cT -----END PGP SIGNATURE----- ------enig2DHOWRXVIVEQPVTLMFMMS--