[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 0/9] qapi-go: add generator for Golang interface
From: |
Victor Toso |
Subject: |
[PATCH v1 0/9] qapi-go: add generator for Golang interface |
Date: |
Wed, 27 Sep 2023 13:25:35 +0200 |
Hi, long time no see!
This patch series intent is to introduce a generator that produces a Go
module for Go applications to interact over QMP with QEMU.
This idea was discussed before, as RFC:
(RFC v1) https://lists.gnu.org/archive/html/qemu-devel/2022-04/msg00226.html
(RFC v2) https://lists.gnu.org/archive/html/qemu-devel/2022-04/msg00226.html
The work got stuck due to changes needed around types that can take JSON
Null as value, but that's now fixed.
I've pushed this series in my gitlab fork:
https://gitlab.com/victortoso/qemu/-/tree/qapi-golang-v1
I've also generated the qapi-go module over QEMU tags: v7.0.0, v7.1.0,
v7.2.6, v8.0.0 and v8.1.1, see the commits history here:
https://gitlab.com/victortoso/qapi-go/-/commits/qapi-golang-v1-by-tags
I've also generated the qapi-go module over each commit of this series,
see the commits history here (using previous refered qapi-golang-v1)
https://gitlab.com/victortoso/qapi-go/-/commits/qapi-golang-v1-by-patch
* Why this?
My main goal is to allow Go applications that interact with QEMU to have
a native way of doing so.
Ideally, we can merge a new QAPI command, update qapi-go module to allow
Go applications to consume the new command in no time (e.g: if
development of said applications are using latest QEMU)
* Expectations
>From previous discussions, there are things that are still missing. One
simple example is Andrea's annotation suggestion to fix type names. My
proposal is to have a qapi-go module in a formal non-stable version till
some of those tasks get addressed or we declare it a non-problem.
I've created a docs/devel/qapi-golang-code-gen.rst to add information
from the discussions we might have in this series. Suggestions always
welcome.
P.S: Sorry about my broken python :)
Cheers,
Victor
Victor Toso (9):
qapi: golang: Generate qapi's enum types in Go
qapi: golang: Generate qapi's alternate types in Go
qapi: golang: Generate qapi's struct types in Go
qapi: golang: structs: Address 'null' members
qapi: golang: Generate qapi's union types in Go
qapi: golang: Generate qapi's event types in Go
qapi: golang: Generate qapi's command types in Go
qapi: golang: Add CommandResult type to Go
docs: add notes on Golang code generator
docs/devel/qapi-golang-code-gen.rst | 341 +++++++++
scripts/qapi/golang.py | 1047 +++++++++++++++++++++++++++
scripts/qapi/main.py | 2 +
3 files changed, 1390 insertions(+)
create mode 100644 docs/devel/qapi-golang-code-gen.rst
create mode 100644 scripts/qapi/golang.py
--
2.41.0