qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 2/3] qom: move user_creatable_add_opts logic to vl.c and Q


From: Paolo Bonzini
Subject: Re: [PATCH v2 2/3] qom: move user_creatable_add_opts logic to vl.c and QAPIfy it
Date: Fri, 16 Apr 2021 16:56:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

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

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