From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Michael Roth" <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] qapi: Add comments to aid debugging generated introspection
Date: Mon, 2 Jul 2018 14:59:38 -0500 [thread overview]
Message-ID: <d0f625bb-54f3-364a-4f47-9ff38fc97935@redhat.com> (raw)
In-Reply-To: <87va9x8omh.fsf@dusky.pond.sub.org>
On 07/02/2018 01:43 PM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> On 06/29/2018 02:55 PM, Eric Blake wrote:
>>> We consciously chose in commit 1a9a507b to hide QAPI type names
>>> from the generated introspection output, but added a command line
>>> option -u to unmask the type name when doing a debug build. At
>>> that time, we generated a monolithic C string, so there was no
>>> better way to do things (we could not really inject comments).
>>>
>>> Later, in commit 7d0f982b, we switched the generation to output
>>> a QLit object, in part to make it easier for future addition of
>>> conditional compilation. But this switch has also made it easier
>>> to interject strategic comments. That commit also forgot to
>>> delete some now-stale comments about long generated line lengths.
>>>
>>> For now, type name debug aid comments are only output once per
>>> meta-type, rather than at all uses of the number used to encode
>>> the type to the introspection data. But this is still a lot
>>> more convenient than having to regenerate the file with the
>>> unmask operation temporarily turned on.
>> ...
> to_qlit() converts from a natural representation of JSON in Python to
> JSON text.
>
> Your patch breaks it for JSON objects that have a member named
> 'comment'.
Hmm. None do, presently. And I don't see where it would be permitted
in the QAPI schema for query-qmp-schema.
>
> Related work: Marc-André's "[PATCH v6 09/15] qapi-introspect: add
> preprocessor conditions to generated QLit" uses tuples to augment JSON.
> He uses them for conditionals, but the technique could be generalized,
> say from his (jobj, ifcond) to (jobj, { 'if': ifcond, '#': comment }.
Yeah, I can probably rebase on top of that (and at this point, it's late
enough to probably have missed 3.0 anyways, so I'm not time-crunched for
getting it done right now).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2018-07-02 19:59 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 [this message]
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
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=d0f625bb-54f3-364a-4f47-9ff38fc97935@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@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).