From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
Cleber Rosa <crosa@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] qapi: Drop qapi-gen --unmask option
Date: Tue, 3 Jul 2018 07:44:44 -0500 [thread overview]
Message-ID: <7a280a92-06d8-cf3b-3755-97f6c5b9b355@redhat.com> (raw)
In-Reply-To: <87o9fo7tp4.fsf@dusky.pond.sub.org>
On 07/03/2018 12:51 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> On 07/02/2018 01:48 PM, Markus Armbruster wrote:
>>> Eric Blake <eblake@redhat.com> writes:
>>>
>>>> Now that we have useful access to the type name as a comment
>>>> in the generated qapi-introspect.c, we don't need to regenerate
>>>> code with a temporary -u option just to get at type names.
>>>>
> # three lines: greeting, output of qmp_capabilities, query-qmp-schema
> return json.loads(out.split('\n')[2])['return']
>
> This returns an abstract syntax tree, represented in Python the obvious
> way. I can then explore it in Python, say search for object types with
> certain properties. For example, commit 2860b2b2cb8:
>
> Thus, the flaw puts an artificial restriction on the QAPI schema: we
> can't have potentially empty objects and arrays within
> BlockdevOptions, except when they're optional and "empty" has the same
> meaning as "absent".
>
> --> Our QAPI schema satisfies this restriction (I checked), but it's a
> trap for the unwary, and a temptation to employ awkward workarounds
> for the wary. Let's get rid of it.
>
> I checked with a Python script that read the schema as shown above.
> Without -u, I'd have to revert the identifier hiding. I could certainly
> write some more Python to read the mapping from the generated C, but
> that feels like busy work.
Good argument. Okay, I'm dropping this patch, and tweaking the other
patch commit message to explain that -u is still useful, even with the
addition of comment aids.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
prev parent reply other threads:[~2018-07-03 12:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 19:55 [Qemu-devel] [PATCH 0/2] qapi: easier debugging of introspection file Eric Blake
2018-06-29 19:55 ` [Qemu-devel] [PATCH 1/2] qapi: Add comments to aid debugging generated introspection Eric Blake
2018-06-29 20:09 ` Eric Blake
2018-07-02 18:43 ` Markus Armbruster
2018-07-02 19:59 ` Eric Blake
2018-07-03 5:38 ` Markus Armbruster
2018-06-29 20:53 ` Eric Blake
2018-06-29 19:55 ` [Qemu-devel] [PATCH 2/2] qapi: Drop qapi-gen --unmask option Eric Blake
2018-06-29 20:18 ` Eduardo Habkost
2018-07-02 18:48 ` Markus Armbruster
2018-07-02 19:55 ` Eric Blake
2018-07-03 5:51 ` Markus Armbruster
2018-07-03 12:44 ` Eric Blake [this message]
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=7a280a92-06d8-cf3b-3755-97f6c5b9b355@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=crosa@redhat.com \
--cc=ehabkost@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).