On 4/25/25 14:07, Pierrick Bouvier wrote:
QAPI/QMP introspection has all commands and events, and all types
reachable from them.  query-qmp-schema returns an array, where each
array element describes one command, event, or type.  When a command,
event, or type is conditional in the schema, the element is wrapped in
the #if generated for the condition.


After reading and answering to your valuable email, I definitely think
the introspection schema we expose should be adapted, independently of
how we build QAPI code (i.e. using #ifdef TARGET or not).

Is it something technically hard to achieve?


From existing json format, we could imagine to change semantic of "if" field to mean "expose in the schema, and register associated commands", instead "introduce ifdefs around this".

QAPI generator would not have to know about what is inside the ifs, simply calling expression passed as value, and condition command registering and schema exposition with that.

Reply via email to