On 13/04/21 11:48, Markus Armbruster wrote:
Oh, there is qapi/qom.json -- maybe that does the trick.

(I have mixed feelings about having to specify the same thing twice at
different locations)

With reason.

We've talked about generating QOM boilerplate from the QAPI schema, but
haven't progressed to actual patches.

There is an initial sketch at
https://wiki.qemu.org/Features/QOM-QAPI_integration, covering what can be done before touching the code generator.

The basic idea is to keep property getters, which allow to read how an object was configured and already vastly reduces the amount of boilerplate, and replace the setters with a method that takes a QAPI visitor.

Later on the low-level QAPI code can be generated by qapi-gen, similar to QMP commands. However, unlike QMP (where QAPIfication included switching from raw QDicts to QAPI structs) here we already start with code that uses vistors and QAPI structs. So it's not like having to rewrite things twice.

Paolo


Reply via email to