# 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.