From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH RFC v4 32/32] qapi-introspect: Hide type names
Date: Fri, 4 Sep 2015 08:07:40 -0600 [thread overview]
Message-ID: <55E9A5AC.2070305@redhat.com> (raw)
In-Reply-To: <1441290623-13631-33-git-send-email-armbru@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3085 bytes --]
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.
>
> Reduces output of query-schema by 13 out of 85KiB.
>
> As a debugging aid, provide option -u to suppress the hiding.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> docs/qapi-code-gen.txt | 36 +++++++++++++++++-------------------
> qapi/introspect.json | 11 +++--------
> scripts/qapi-introspect.py | 41 +++++++++++++++++++++++++++++++++++------
> 3 files changed, 55 insertions(+), 33 deletions(-)
>
> 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.
>
> -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 '.'
>
> 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.
>
> @@ -1053,13 +1051,13 @@ Example:
> [Uninteresting stuff omitted...]
>
> const char example_qmp_schema_json[] = "["
> - "{\"arg-type\": \":empty\", \"meta-type\": \"event\", \"name\": \"MY_EVENT\"}, "
> + "{\"arg-type\": \"0\", \"meta-type\": \"event\", \"name\": \"MY_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 <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-09-04 14:07 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-03 14:29 [Qemu-devel] [PATCH RFC v4 00/32] qapi: QMP introspection Markus Armbruster
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 01/32] qapi: Rename class QAPISchema to QAPISchemaParser Markus Armbruster
2015-09-03 15:55 ` Daniel P. Berrange
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 02/32] qapi: New QAPISchema intermediate reperesentation Markus Armbruster
2015-09-03 16:11 ` Daniel P. Berrange
2015-09-04 7:12 ` Markus Armbruster
2015-09-04 8:51 ` Daniel P. Berrange
2015-09-04 11:13 ` Markus Armbruster
2015-09-04 3:05 ` Eric Blake
2015-09-04 12:34 ` Eric Blake
2015-09-04 14:40 ` Markus Armbruster
2015-09-04 23:51 ` [Qemu-devel] [PATCH RFC v4 02.5/32] qapi: Hide internal data members of schema objects Eric Blake
2015-09-05 13:19 ` Eric Blake
2015-09-05 13:25 ` Eric Blake
2015-09-05 13:45 ` Eric Blake
2015-09-07 6:57 ` Markus Armbruster
2015-09-07 6:58 ` Markus Armbruster
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 03/32] qapi: QAPISchema code generation helper methods Markus Armbruster
2015-09-03 16:13 ` Daniel P. Berrange
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 04/32] qapi: New QAPISchemaVisitor Markus Armbruster
2015-09-03 16:16 ` Daniel P. Berrange
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 05/32] tests/qapi-schema: Convert test harness to QAPISchemaVisitor Markus Armbruster
2015-09-03 16:18 ` Daniel P. Berrange
2015-09-03 16:24 ` Eric Blake
2015-09-05 13:23 ` Eric Blake
2015-09-07 7:10 ` Markus Armbruster
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 06/32] qapi: Split up some typedefs to ease review Markus Armbruster
2015-09-03 16:19 ` Daniel P. Berrange
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 07/32] qapi: Generate comments to simplify splitting for review Markus Armbruster
2015-09-03 16:21 ` Daniel P. Berrange
2015-09-03 14:29 ` [Qemu-devel] [PATCH RFC v4 08/32] Revert "qapi: Generate comments to simplify splitting for review" Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 09/32] Revert "qapi: Split up some typedefs to ease review" Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 10/32] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions Markus Armbruster
2015-09-04 3:11 ` Eric Blake
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 11/32] qapi-visit: Convert to QAPISchemaVisitor, fixing bugs Markus Armbruster
2015-09-04 3:14 ` Eric Blake
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 12/32] qapi-commands: Convert to QAPISchemaVisitor Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 13/32] qapi: De-duplicate enum code generation Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 14/32] qapi-event: Eliminate global variable event_enum_value Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 15/32] qapi-event: Convert to QAPISchemaVisitor, fixing data with base Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 16/32] qapi: Generate comments to simplify splitting for review Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 17/32] Revert "qapi: Generate comments to simplify splitting for review" Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 18/32] qapi: Replace dirty is_c_ptr() by method c_null() Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 19/32] qapi: Clean up after recent conversions to QAPISchemaVisitor Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 20/32] qapi-visit: Rearrange code a bit Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 21/32] qapi-commands: Rearrange code Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 22/32] qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO() Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 23/32] qapi: De-duplicate parameter list generation Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 24/32] qapi-commands: De-duplicate output marshaling functions Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 25/32] qapi: Improve built-in type documentation Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 26/32] qapi: Introduce a first class 'any' type Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 27/32] qom: Don't use 'gen': false for qom-get, qom-set, object-add Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 28/32] qapi-schema: Fix up misleading specification of netdev_add Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 29/32] qapi: Pseudo-type '**' is now unused, drop it Markus Armbruster
2015-09-03 20:42 ` Eric Blake
2015-09-04 7:14 ` Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 30/32] qapi: New QMP command query-schema for QMP schema introspection Markus Armbruster
2015-09-03 20:50 ` Eric Blake
2015-09-04 0:04 ` Michael Roth
2015-09-04 7:19 ` Markus Armbruster
2015-09-03 23:59 ` Michael Roth
2015-09-04 8:54 ` Markus Armbruster
2015-09-04 2:03 ` Eric Blake
2015-09-04 3:12 ` Eric Blake
2015-09-04 9:55 ` Markus Armbruster
2015-09-04 13:58 ` Eric Blake
2015-09-04 15:08 ` Markus Armbruster
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 31/32] qapi-introspect: Map all integer types to 'int' Markus Armbruster
2015-09-04 14:00 ` Eric Blake
2015-09-03 14:30 ` [Qemu-devel] [PATCH RFC v4 32/32] qapi-introspect: Hide type names Markus Armbruster
2015-09-04 14:07 ` Eric Blake [this message]
2015-09-04 15:52 ` Markus Armbruster
2015-09-04 12:57 ` [Qemu-devel] [PATCH RFC v4 00/32] qapi: QMP introspection Marc-André Lureau
2015-09-04 14:14 ` Eric Blake
2015-09-04 15:55 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55E9A5AC.2070305@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).