qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] qapi: Drop qapi-gen --unmask option


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/2] qapi: Drop qapi-gen --unmask option
Date: Tue, 3 Jul 2018 07:44:44 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/03/2018 12:51 AM, Markus Armbruster wrote:
Eric Blake <address@hidden> writes:

On 07/02/2018 01:48 PM, Markus Armbruster wrote:
Eric Blake <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]