From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXreZ-0003q8-Oi for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXreY-0002iV-ID for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:07:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXreY-0002iO-BE for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:07:42 -0400 References: <1441290623-13631-1-git-send-email-armbru@redhat.com> <1441290623-13631-33-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55E9A5AC.2070305@redhat.com> Date: Fri, 4 Sep 2015 08:07:40 -0600 MIME-Version: 1.0 In-Reply-To: <1441290623-13631-33-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E3qomBhu5flCjHHQqbXlSu1BFDGM0gh2n" Subject: Re: [Qemu-devel] [PATCH RFC v4 32/32] qapi-introspect: Hide type names 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) --E3qomBhu5flCjHHQqbXlSu1BFDGM0gh2n Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/03/2015 08:30 AM, Markus Armbruster wrote: > To eliminate the temptation for clients to look up types by name > (which are not ABI), replace all type names by meaningless strings. >=20 > Reduces output of query-schema by 13 out of 85KiB. >=20 > As a debugging aid, provide option -u to suppress the hiding. >=20 > Signed-off-by: Markus Armbruster > --- > docs/qapi-code-gen.txt | 36 +++++++++++++++++------------------- > qapi/introspect.json | 11 +++-------- > scripts/qapi-introspect.py | 41 +++++++++++++++++++++++++++++++++++---= --- > 3 files changed, 55 insertions(+), 33 deletions(-) >=20 > diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt > index a079b51..94fc296 100644 > --- a/docs/qapi-code-gen.txt > +++ b/docs/qapi-code-gen.txt > @@ -516,13 +516,16 @@ additional variant members depending on the value= of meta-type. > Each SchemaInfo object describes a wire ABI entity of a certain > meta-type: a command, event or one of several kinds of type. > =20 > -SchemaInfo for entities defined in the QAPI schema have the same name > -as in the schema. This is the case for all commands and events, and > -most types. > +SchemaInfo for commands and events have the same name as in the QAPI > +schema Missing a trailing '.' > =20 > Command and event names are part of the wire ABI, but type names are > -not. Therefore, looking up a type by its name in the QAPI schema is > -wrong. Look up the command or event, then follow references by name. > +not. Therefore, the SchemaInfo for types have auto-generated > +meaningless names. For readability, the examples in this document use= > +meaningful type names instead. > + > +To examine a type, start with a the command or event using it, then s/a the/the/ > +follow references by name. > =20 > @@ -1053,13 +1051,13 @@ Example: > [Uninteresting stuff omitted...] > =20 > const char example_qmp_schema_json[] =3D "[" > - "{\"arg-type\": \":empty\", \"meta-type\": \"event\", \"name\"= : \"MY_EVENT\"}, " > + "{\"arg-type\": \"0\", \"meta-type\": \"event\", \"name\": \"M= Y_EVENT\"}, " > + "{\"arg-type\": \"1\", \"meta-type\": \"command\", \"name\": \= "my-command\", \"ret-type\": \"2\"}, " I thought you said that this document would use the meaningful type names? Oh, I see - the earlier examples (not touched by this commit) DO use meaningful names; while _this_ example uses the munged names. I don't know if any additional wording would help. Would it be worth documenting -u as a usage argument for qapi-introspect.py? [For that matter, should we document what -m for middle-mode does for qapi-commands.py? But as a separate patch] I still think that masking arrays as "[123]" is nicer, but that can be a followup patch (especially since I've already posted it in one of my numerous RFC followups, which I'll have to rebase anyways) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --E3qomBhu5flCjHHQqbXlSu1BFDGM0gh2n 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/ iQEcBAEBCAAGBQJV6aWsAAoJEKeha0olJ0NqGLsH/iN7JiE3KKB4NdsebuXuwAz+ MfixvoM2dozrkd26ffXRSk6x4LMY+SNgyoA4gA45Elg0Delg5r4qy/0+kWdOCtUS sIi+cgW4CmJdJTFGBZgLGjYeyImFur8hDSI2EFAuGgXNsF+5wrT2rPl+fN67Ck0v l/V2wfQb73nwSpq2lBryWI+Yom0ucn9l/4HH8ugvpjstqirRxsT4+dWLTioYgbZh Hlmjbg8rxyb8I5Ic/ll/St6o1ZpNhU12iYyN+TZCEU6UvFTjFtw3YZFHKGydi/4q 880s+EqWktZoCDfHzibB65YVi/wv90otHipl0hfPyBq81yRXnkK4/RNAscQQRTo= =n6jC -----END PGP SIGNATURE----- --E3qomBhu5flCjHHQqbXlSu1BFDGM0gh2n--