From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: Victor Toso <victortoso@redhat.com>,
Michael Roth <michael.roth@amd.com>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH] qapi: pluggable backend code generators
Date: Mon, 17 Feb 2025 15:34:42 +0100 [thread overview]
Message-ID: <aee87bbe-e5dc-44af-98ea-be3ce7237af9@linaro.org> (raw)
In-Reply-To: <20250217134927.1288486-1-berrange@redhat.com>
On 17/2/25 14:49, Daniel P. Berrangé wrote:
> The 'qapi.backend.QAPIBackend' class defines an API contract for
> code generators. The current generator is put into a new class
> 'qapi.backend.QAPICBackend' and made to be the default impl.
>
> A custom generator can be requested using the '-k' arg which takes
> a fully qualified python class name
>
> qapi-gen.py -k the.python.module.QAPIMyBackend
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>
> This is an impl of the idea I mentioned at:
>
> https://lists.nongnu.org/archive/html/qemu-devel/2025-02/msg03475.html
>
> With this change, it is possible for the Go generator code to live
> outside of qemu.git, invoked using:
>
> $ PYTHONPATH=/path/to/qemu.git/scripts \
> python /path/to/qemu.git/scripts/qapi-gen.py \
> -o somedir \
> -k qapi.golang.golang.QAPIGoBackend \
> /path/to/qemu.git/qga/qapi-schema.json
>
> The external app could just expect qemu.git to be checkedout somewhere
> convenient, or could use a git submodule to reference it.
>
> scripts/qapi/backend.py | 96 +++++++++++++++++++++++++++++++++++++++++
> scripts/qapi/main.py | 65 ++++++++--------------------
> 2 files changed, 113 insertions(+), 48 deletions(-)
> create mode 100644 scripts/qapi/backend.py
Good idea.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
next prev parent reply other threads:[~2025-02-17 14:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 13:49 [PATCH] qapi: pluggable backend code generators Daniel P. Berrangé
2025-02-17 14:34 ` Philippe Mathieu-Daudé [this message]
2025-02-20 7:58 ` Markus Armbruster
2025-02-25 12:11 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aee87bbe-e5dc-44af-98ea-be3ce7237af9@linaro.org \
--to=philmd@linaro.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=michael.roth@amd.com \
--cc=qemu-devel@nongnu.org \
--cc=victortoso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).