On Fri, Mar 07, 2025 at 12:49:59PM +, Daniel P. Berrangé wrote:
> On Fri, Mar 07, 2025 at 01:30:38PM +0100, Victor Toso wrote:
> > Hi,
> >
> > I've been working on and off in having Go bindings for QEMU's
> > QAPI specification. The last version [0] s
Hi,
I've been working on and off in having Go bindings for QEMU's
QAPI specification. The last version [0] seems to be accepted so
far but we would like not to have that in qemu.git.
In the past [1], Daniel suggested creating a repo per each
generated schema: go-qemu.git, go-qga.git, go-qsd.git
Hi,
On Mon, Feb 17, 2025 at 05:52:49PM +0100, Victor Toso wrote:
> On Mon, Feb 17, 2025 at 02:58:22PM +, Daniel P. Berrangé wrote:
> > On Fri, Feb 14, 2025 at 09:29:33PM +0100, Victor Toso wrote:
> > >
> > > # Expectations #
> > > #
Hi,
On Mon, Feb 17, 2025 at 02:58:22PM +, Daniel P. Berrangé wrote:
> On Fri, Feb 14, 2025 at 09:29:33PM +0100, Victor Toso wrote:
> > Hi again,
> >
> > This patch series intent is to introduce a generator that produces a Go
> > module for Go applications to
The goal of this patch is converge discussions into a documentation,
to make it easy and explicit design decisions, known issues and what
else might help a person interested in how the Go module is generated.
Signed-off-by: Victor Toso
---
docs/devel/index-build.rst | 1 +
docs/devel
The Event interface is an abstraction that can be used by client and
server to the manager the Event types albeit with a different
implementation for sending and receiving.
The implementation of client/server is not part of this series.
Signed-off-by: Victor Toso
---
scripts/qapi/golang
ts to 'keep'. For VNC, only 'keep'
| // is currently implemented.
| Connected *SetPasswordAction `json:"connected,omitempty"`
| // Variants fields
| Vnc *SetPasswordOptionsVnc `json:"-"`
| // Unbranched enum fields
| Spice bool `json
to add to the image file; 0 for not adding an
| // extent size hint (default: 1 MB, since 5.1)
| ExtentSizeHint *uint64 `json:"extent-size-hint,omitempty"`
| }
Signed-off-by: Victor Toso
---
scripts/qapi/golang/golang.py | 193 +-
1 file chang
uot;, "arguments": {
| // "fdset-id": 1 } } <- { "return": { "fdset-id": 1, "fd": 3 } }
| type AddFdCommand struct {
| // The ID of the fd set to add the file descriptor to.
| FdsetId *int64 `json:"fdset-id,omitempty"`
arshaling from JSON.
This patch handles this very specific case:
- It implements the Marshaler interface for these structs to properly
handle these values.
- It adds the interface AbsentAlternate() and implement it for any
Alternate that can be JSON Null. See its uses in map_and_set()
Sign
is not part of this series.
Signed-off-by: Victor Toso
---
scripts/qapi/golang/golang.py | 56 +++
1 file changed, 50 insertions(+), 6 deletions(-)
diff --git a/scripts/qapi/golang/golang.py b/scripts/qapi/golang/golang.py
index a14970fb1f..0b7dadff41 100644
--- a
d/device[2]" }, "timestamp": { "seconds":
| // 1588168529, "microseconds": 201316 } }
| type MemoryDeviceSizeChangeEvent struct {
| // device's ID
| Id *string `json:"id,omitempty"`
| // the new size of memory that the device p
rent meaning.
| //
| // Since: 2.10
| type StrOrNull struct {
| // the string value
| S *string
| // no string value
| IsNull bool
| }
|
| // Helper function to get its underlying Go value or absent of value
| func (s *StrOrNull) ToAnyOrAbsent() (any, boo
ata': [ 'vnc', 'spice' ] }
go:
| // Display protocols which support changing password options.
| //
| // Since: 7.0
| type DisplayProtocol string
|
| const (
| DisplayProtocolVnc DisplayProtocol = "vnc"
| DisplayProtocolSpice DisplayProtoc
rged we would need to:
1. Create gitlab's repo
2. Add unit test and CI to new repos
3. Have first alpha relase/tag
4. Start working on top :)
Thanks for the time looking at this. I appreciate it.
Victor Toso (11):
qapi: golang: first level unmarshalling type
qapi: golang: Generate en
te any patch of this series with:
python3 ./scripts/qapi-gen.py -o /tmp/out qapi/qapi-schema.json
Signed-off-by: Victor Toso
---
scripts/qapi/golang/__init__.py | 0
scripts/qapi/golang/golang.py | 135
scripts/qapi/golang/protocol.go | 48
Hi,
On Tue, Feb 11, 2025 at 11:10:37AM +, Daniel P. Berrangé wrote:
> On Tue, Feb 11, 2025 at 11:25:05AM +0100, Victor Toso wrote:
> > Hi,
> >
> > On Thu, Jan 16, 2025 at 09:59:52PM +, Daniel P. Berrangé wrote:
> > > <<<<
Hi,
On Thu, Jan 16, 2025 at 09:59:52PM +, Daniel P. Berrangé wrote:
> Pause here if you've read enough for now.
>
>
>
> As a way to validate these thoughts, I spent a day to mock up a demo
> of a QAPI client and server implementation.
>
> First I created some manually written
Hi,
On Thu, Jan 16, 2025 at 09:59:52PM +, Daniel P. Berrangé wrote:
> On Fri, Jan 10, 2025 at 11:49:38AM +0100, Victor Toso wrote:
> > I've pushed this series in my gitlab fork:
> > https://gitlab.com/victortoso/qapi-go/
> >
> > The fork contains some
Hi,
On Fri, Jan 17, 2025 at 10:10:51AM +, Daniel P. Berrangé wrote:
> On Fri, Jan 10, 2025 at 11:49:39AM +0100, Victor Toso wrote:
> > This patch handles QAPI enum types and generates its equivalent in Go.
> > We sort the output based on enum's type name.
> >
>
Hi,
On Mon, Jan 13, 2025 at 01:52:25PM +0100, Markus Armbruster wrote:
> Victor Toso writes:
>
> > This patch series intent is to introduce a generator that produces a Go
> > module for Go applications to interact over QMP with QEMU.
> >
> > The initial Goal is to
Hi,
On Tue, Jan 14, 2025 at 09:52:23AM +0100, Markus Armbruster wrote:
> Victor Toso writes:
>
> > This patch handles QAPI enum types and generates its equivalent in Go.
> > We sort the output based on enum's type name.
>
> Any particular reason for sorting?
It w
drea)
On python script:
- rebased: now uses QAPISchemaBranches, QAPISchemaAlternatives
- use textwrap as much as possible (Andrea)
- lots of changes to make the output like gofmt does
Victor Toso (8):
qapi: golang: Generate enum type
qapi: golang: Generate alternate types
qapi: golang: Generate
arshal([]byte(input), &c)
| if err != nil {
| panic(err)
| }
| // c.Password == "secret"
| }
|
| // Generic way, using Command interface and helper function
| if cmd, err := GetCommandType(input); err != nil {
| // handle bad data or unknown event
| }
arshaling from JSON.
This patch handles this very specific case:
- It implements the Marshaler interface for these structs to properly
handle these values.
- It adds the interface AbsentAlternate() and implement it for any
Alternate that can be JSON Null. See its uses in map_and_set()
Signed-of
rent meaning.
| //
| // Since: 2.10
| type StrOrNull struct {
| // the string value
| S *string
| // no string value
| IsNull bool
| }
|
| // Helper function to get its underlying Go value or absent of value
| func (s *StrOrNull) ToAnyOrAbsent() (any, bool)
The goal of this patch is converge discussions into a documentation,
to make it easy and explicit design decisions, known issues and what
else might help a person interested in how the Go module is generated.
Signed-off-by: Victor Toso
---
docs/devel/index-build.rst | 1 +
docs/devel
ata': [ 'vnc', 'spice' ] }
go:
| // Display protocols which support changing password options.
| //
| // Since: 7.0
| type DisplayProtocol string
|
| const (
| DisplayProtocolVnc DisplayProtocol = "vnc"
| DisplayProtocolSpice DisplayProtoc
ts to 'keep'. For VNC, only 'keep'
| // is currently implemented.
| Connected *SetPasswordAction `json:"connected,omitempty"`
| // Variants fields
| Vnc *SetPasswordOptionsVnc `json:"-"`
| // Unbranched enum fields
| Spice bool `jso
| // Straight forward if you know the event type
| {
| mdsc := MemoryDeviceSizeChangeEvent{}
| err := json.Unmarshal([]byte(input), &mdsc)
| if err != nil {
| panic(err)
| }
| // mdsc.QomPath == "/machine/unattached/
to add to the image file; 0 for not adding an
| // extent size hint (default: 1 MB, since 5.1)
| ExtentSizeHint *uint64 `json:"extent-size-hint,omitempty"`
| }
Signed-off-by: Victor Toso
---
scripts/qapi/golang.py | 199 -
1 fil
As described in docs/devel/qapi-code-gen.rst line 998,
there should be no space between "Since" and ":".
Signed-off-by: Victor Toso
---
qapi/cxl.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qapi/cxl.json b/qapi/cxl.json
index 9f65589bce..dd9
9:24PM +0200, Victor Toso wrote:
> > Hi,
> >
> > This is the second iteration of RFC v1:
> > https://lists.gnu.org/archive/html/qemu-devel/2022-04/msg00226.html
> >
> >
> > # What this is about?
> >
> > To generate a simple Golang interface
Hi,
On Fri, Nov 10, 2023 at 01:54:50AM -0800, Andrea Bolognani wrote:
> On Thu, Nov 09, 2023 at 07:35:04PM +0100, Victor Toso wrote:
> > On Thu, Nov 09, 2023 at 09:29:28AM -0800, Andrea Bolognani wrote:
> > > Additionally, this would allow client code that *looks* at the
&
Hi,
On Fri, Nov 10, 2023 at 01:58:20AM -0800, Andrea Bolognani wrote:
> On Thu, Nov 09, 2023 at 08:01:48PM +0100, Victor Toso wrote:
> > On Thu, Nov 09, 2023 at 09:34:56AM -0800, Andrea Bolognani wrote:
> > > We should call this Null instead of IsNull, and also make it a
>
Hi,
On Thu, Nov 09, 2023 at 10:24:20AM -0800, Andrea Bolognani wrote:
> On Mon, Oct 16, 2023 at 05:27:03PM +0200, Victor Toso wrote:
> > This patch adds a struct type in Go that will handle return values
> > for QAPI's command types.
> >
> > The return value o
Hi,
On Thu, Nov 09, 2023 at 09:59:50AM -0800, Andrea Bolognani wrote:
> On Mon, Oct 16, 2023 at 05:27:01PM +0200, Victor Toso wrote:
> > This patch handles QAPI event types and generates data structures in
> > Go that handles it.
> >
> > We also define a Event interfa
Hi,
On Thu, Nov 09, 2023 at 10:35:07AM -0800, Andrea Bolognani wrote:
> On Mon, Oct 16, 2023 at 05:26:53PM +0200, Victor Toso wrote:
> > This patch series intent is to introduce a generator that produces a Go
> > module for Go applications to interact over QMP with QEMU.
>
Hi,
On Thu, Nov 09, 2023 at 09:34:56AM -0800, Andrea Bolognani wrote:
> On Mon, Oct 16, 2023 at 05:26:57PM +0200, Victor Toso wrote:
> > [*] The exception for optional fields as default is to Types that can
> > accept JSON Null as a value. For this case, we translate NULL to a
Hi,
On Thu, Nov 09, 2023 at 09:29:28AM -0800, Andrea Bolognani wrote:
> On Mon, Oct 16, 2023 at 05:27:00PM +0200, Victor Toso wrote:
> > This patch handles QAPI union types and generates the equivalent data
> > structures and methods in Go to handle it.
> >
> > The QA
Hi,
On Mon, Nov 06, 2023 at 07:28:04AM -0800, Andrea Bolognani wrote:
> On Mon, Oct 16, 2023 at 05:26:57PM +0200, Victor Toso wrote:
> > This patch handles QAPI alternate types and generates data structures
> > in Go that handles it.
> >
> > Alternate types are sim
Hi,
On Fri, Nov 03, 2023 at 11:34:18AM -0700, Andrea Bolognani wrote:
> On Tue, Oct 31, 2023 at 09:42:10AM -0700, Andrea Bolognani wrote:
> > On Fri, Oct 27, 2023 at 07:33:30PM +0200, Victor Toso wrote:
> > > Hi,
> > >
> > > Daniel & Andrea, it wo
ata type names)
- scripts/qapi library wrt to generating interfaces in other
languages other than C
I would love to have this prior to 8.2 feature freeze if the
idea and current code meet your expectations.
Cheers,
Victor
On Mon, Oct 16, 2023 at 05:26:53PM +0200, Victor Toso wrote:
>
Hi Markus,
Sorry the delay on reply here.
On Thu, Sep 21, 2023 at 01:06:01PM +0200, Markus Armbruster wrote:
> Victor Toso writes:
>
> > This generator has two goals:
> > 1. Mechanical validation of QAPI examples
> > 2. Generate the examples in a JSON format
Hi,
On Wed, Oct 18, 2023 at 01:47:56PM +0200, Markus Armbruster wrote:
> Victor Toso writes:
>
> > The goal of this patch is converge discussions into a documentation,
> > to make it easy and explicit design decisions, known issues and what
> > else might help a person
On Wed, Oct 18, 2023 at 01:00:07PM +0200, Markus Armbruster wrote:
> Victor Toso writes:
>
> > flake8 complained:
> > ./main.py:60:1: E302 expected 2 blank lines, found 1
> >
> > Which is simple enough. My vim has black [0] enabled by default, so it
>
uot;data":{"id":"vm0","size":1073741824,"qom-path":"/machine/unattached/device[2]"}}`
| e, err := UnmarshalEvent([]byte(input)
| if err != nil {
| panic(err)
| }
| if e.GetName() == `MEMORY_DEVICE_SIZE_CHANGE` {
| m := e.(*MemoryDevi
go:
| type BlockdevCreateOptionsFile struct {
| Filename string`json:"filename"`
| Size uint64`json:"size"`
| Preallocation *PreallocMode `json:"preallocation,omitempty"`
| Nocow *bool
DisplayProtocol = "vnc"
| DisplayProtocolSpice DisplayProtocol = "spice"
| )
Signed-off-by: Victor Toso
---
scripts/qapi/golang.py | 173 +
scripts/qapi/main.py | 3 +
2 files changed, 176 insertions(+)
create mode 100644
ded a fix from John
https://lists.gnu.org/archive/html/qemu-devel/2023-10/msg01305.html
- Added a tangent fix suggestion to main.py "scripts: qapi: black
format main.py"
John Snow (1):
qapi: re-establish linting baseline
Victor Toso (10):
scripts: qapi: black format main.py
qapi: go
arshaling from JSON.
This patch handles this very specific case:
- It implements the Marshaler interface for these structs to properly
handle these values.
- It adds the interface AbsentAlternate() and implement it for any
Alternate that can be JSON Null
Signed-off-by: Victor Toso
---
scrip
Go. This will be
explained better in the documentation patch of this series but the
main rationale is around Marshaling to and from JSON and Go data
structures.
Example:
qapi:
| { 'alternate': 'StrOrNull',
| 'data': { 's': 'str'
minator': 'protocol',
| 'data': { 'vnc': 'SetPasswordOptionsVnc' } }
go:
| type SetPasswordOptions struct {
| Password string `json:"password"`
| Connected *SetPasswordAction `json:"connected,omitempty"`
|
The goal of this patch is converge discussions into a documentation,
to make it easy and explicit design decisions, known issues and what
else might help a person interested in how the Go module is generated.
Signed-off-by: Victor Toso
---
docs/devel/index-build.rst | 1 +
docs/devel
e" : "running",` +
|`"handle" : 1 } } `
|
| ret := QuerySevCommandReturn{}
| err := json.Unmarshal([]byte(input), &ret)
| if ret.Error != nil {
| // Handle command failure {"error": { ...}}
| } else if ret.Result !
f c.GetName() == `set_password` {
| m := c.(*SetPasswordCommand)
| // m.Password == "secret"
| }
Signed-off-by: Victor Toso
---
scripts/qapi/golang.py | 116 -
1 file changed, 114 insertions(+), 2 deletions(-)
diff --git a/s
From: John Snow
Some very minor housekeeping to make the linters happy once more.
Signed-off-by: John Snow
---
scripts/qapi/gen.py| 2 +-
scripts/qapi/parser.py | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index bf5716b
flake8 complained:
./main.py:60:1: E302 expected 2 blank lines, found 1
Which is simple enough. My vim has black [0] enabled by default, so it
did some extra formatting. I'm proposing to follow it.
[0] https://black.readthedocs.io/en/stable/
Signed-off-by: Victor Toso
---
scripts
Hi,
On Thu, Sep 28, 2023 at 03:32:54PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:42PM +0200, Victor Toso wrote:
> > This patch handles QAPI command types and generates data structures in
> > Go that decodes from QMP JSON Object to Go data structure and
Hi,
On Fri, Sep 29, 2023 at 03:41:27PM +0200, Victor Toso wrote:
> Hi,
>
> On Thu, Sep 28, 2023 at 03:21:59PM +0100, Daniel P. Berrangé wrote:
> > On Wed, Sep 27, 2023 at 01:25:40PM +0200, Victor Toso wrote:
> > > This patch handles QAPI union types and gener
Hi,
On Mon, Oct 02, 2023 at 05:48:37PM -0400, John Snow wrote:
> On Fri, Sep 29, 2023 at 8:37 AM Daniel P. Berrangé
> wrote:
> >
> > On Fri, Sep 29, 2023 at 02:23:22PM +0200, Victor Toso wrote:
> > > Hi,
> > >
> > > On Thu, Sep 28, 2023 at 03:51:50P
Hi,
On Mon, Oct 02, 2023 at 04:36:11PM -0400, John Snow wrote:
> On Wed, Sep 27, 2023 at 7:25 AM Victor Toso wrote:
> >
> > This patch handles QAPI alternate types and generates data structures
> > in Go that handles it.
> >
> > Alternate types are similar to
Hi,
On Mon, Oct 02, 2023 at 04:09:29PM -0400, John Snow wrote:
> On Mon, Oct 2, 2023 at 3:07 PM John Snow wrote:
> >
> > On Wed, Sep 27, 2023 at 7:25 AM Victor Toso wrote:
> > >
> > > This patch handles QAPI enum types and generates its equivalent in Go.
>
Hi,
On Mon, Oct 02, 2023 at 03:07:49PM -0400, John Snow wrote:
> On Wed, Sep 27, 2023 at 7:25 AM Victor Toso wrote:
> >
> > This patch handles QAPI enum types and generates its equivalent in Go.
> >
> > Basically, Enums are being handled as strings in Golang.
> &
Hi,
On Thu, Sep 28, 2023 at 02:40:27PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:35PM +0200, Victor Toso wrote:
> > Hi, long time no see!
> >
> > This patch series intent is to introduce a generator that produces a Go
> > module for Go applic
Hi,
On Thu, Sep 28, 2023 at 02:54:10PM +0100, Daniel P. Berrangé wrote:
> On Thu, Sep 28, 2023 at 02:40:27PM +0100, Daniel P. Berrangé wrote:
> > On Wed, Sep 27, 2023 at 01:25:35PM +0200, Victor Toso wrote:
> > IOW, it would push towards
> >
> >go-qemu.git
> >
Hi,
On Thu, Sep 28, 2023 at 04:03:12PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:43PM +0200, Victor Toso wrote:
> > This patch adds a struct type in Go that will handle return values
> > for QAPI's command types.
> >
> > The return value o
Hi,
On Thu, Sep 28, 2023 at 03:32:54PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:42PM +0200, Victor Toso wrote:
> > This patch handles QAPI command types and generates data structures in
> > Go that decodes from QMP JSON Object to Go data structure and
Hi,
On Thu, Sep 28, 2023 at 03:21:59PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:40PM +0200, Victor Toso wrote:
> > This patch handles QAPI union types and generates the equivalent data
> > structures and methods in Go to handle it.
> >
> >
Hi,
On Thu, Sep 28, 2023 at 03:06:23PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:38PM +0200, Victor Toso wrote:
> > This patch handles QAPI struct types and generates the equivalent
> > types in Go. The following patch adds extra logic when a member of the
&
Hi,
On Thu, Sep 28, 2023 at 03:51:50PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:37PM +0200, Victor Toso wrote:
> > This patch handles QAPI alternate types and generates data structures
> > in Go that handles it.
>
> This file (and most others) nee
Hi,
On Thu, Sep 28, 2023 at 02:52:08PM +0100, Daniel P. Berrangé wrote:
> On Wed, Sep 27, 2023 at 01:25:36PM +0200, Victor Toso wrote:
> > This patch handles QAPI enum types and generates its equivalent in Go.
> >
> > Basically, Enums are being handled as strings in Golang.
27, 2023 at 01:25:44PM +0200, Victor Toso wrote:
> > The goal of this patch is converge discussions into a documentation,
> > to make it easy and explicit design decisions, known issues and what
> > else might help a person interested in how the Go module is generated.
On Wed, Sep 27, 2023 at 01:25:35PM +0200, Victor Toso wrote:
> 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:
go:
| type BlockdevCreateOptionsFile struct {
| Filename string`json:"filename"`
| Size uint64`json:"size"`
| Preallocation *PreallocMode `json:"preallocation,omitempty"`
| Nocow *bool
The goal of this patch is converge discussions into a documentation,
to make it easy and explicit design decisions, known issues and what
else might help a person interested in how the Go module is generated.
Signed-off-by: Victor Toso
---
docs/devel/qapi-golang-code-gen.rst | 341
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:
| DisplayProtocolVnc DisplayProtocol = "vnc"
| DisplayProtocolSpice DisplayProtocol = "spice"
| )
Signed-off-by: Victor Toso
---
scripts/qapi/golang.py | 140 +
scripts/qapi/main.py | 2 +
2 files changed, 142 insertions(+)
create m
uot;data":{"id":"vm0","size":1073741824,"qom-path":"/machine/unattached/device[2]"}}`
| e, err := UnmarshalEvent([]byte(input)
| if err != nil {
| panic(err)
| }
| if e.GetName() == `MEMORY_DEVICE_SIZE_CHANGE` {
| m := e.(*MemoryDevi
",` +
| `"arguments":{"protocol":"vnc",` +
| `"password":"secret"}}`
|
| c, err := UnmarshalCommand([]byte(input))
| if err != nil {
| panic(err)
| }
|
| if c.GetName() == `set_password` {
| m
or': 'protocol',
| 'data': { 'vnc': 'SetPasswordOptionsVnc' } }
go:
| type SetPasswordOptions struct {
| Protocol DisplayProtocol`json:"protocol"`
| Password string `json:"password"`
| Connected *Se
e" : "running",` +
|`"handle" : 1 } } `
|
| ret := QuerySevCommandReturn{}
| err := json.Unmarshal([]byte(input), &ret)
| if ret.Error != nil {
| // Handle command failure {"error": { ...}}
| } else if ret.Result
s to properly
handle these values.
- It adds the interface AbsentAlternate() and implement it for any
Alternate that can be JSON Null
Signed-off-by: Victor Toso
---
scripts/qapi/golang.py | 195 ++---
1 file changed, 184 insertions(+), 11 deletions(
boolean value in a field called
IsNull. This will be explained better in the documentation patch of
this series but the main rationale is around Marshaling to and from
JSON and Go data structures.
Example:
qapi:
| { 'alternate': 'StrOrNull',
| 'data': { 's'
Example output lacks double quotes. Fix it.
Fixes: 4cda177c60 "qmp: add 'get-win32-socket'"
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Markus Armbruster
---
qapi/misc.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/q
Example output has a comment embedded in the array. Remove it.
The end result is a list of size 2.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
---
qapi/ui.json | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/qapi/ui.json b/qapi/ui.json
index 006616aa77
Example output has several missing commas. Add them.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Markus Armbruster
---
qapi/block-core.json | 32
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/qapi/block-core.json b
Example output has property name with single quotes. Fix it.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Markus Armbruster
---
qapi/migration.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/migration.json b/qapi/migration.json
index
Example output has extra end curly bracket. Switch with comma.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Markus Armbruster
---
qapi/machine.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index
into "sequence-order". A language binding project can then
consume this files to Marshal and Unmarshal, comparing if the results
are what is to be expected.
RFC discussion:
https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04641.html
Signed-off-by: Victor Toso
---
scripts/qapi
Example output was using single quotes. Fix it.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Markus Armbruster
---
qapi/net.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qapi/net.json b/qapi/net.json
index 313c8a606e..81988e499a
Example output has extra end curly bracket. Remove it.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Markus Armbruster
---
qapi/migration.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/migration.json b/qapi/migration.json
index
Example output has extra end curly bracket. Remove it.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Markus Armbruster
---
qapi/migration.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/migration.json b/qapi/migration.json
index
Example output has a comment embedded in the array. Remove it.
The end result is a list of size 1.
Signed-off-by: Victor Toso
Reviewed-by: Daniel P. Berrangé
---
qapi/rocker.json | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/qapi/rocker.json b/qapi/rocker.json
index
in self.schema._entity_dict)
obj = self.schema._entity_dict[name]
+
+if not obj.info.pragma.doc_required:
+return
+
assert((obj.doc is not None))
module_name = obj._module.name
which avoid failures with tests that don't have any docs.
Ch
Hi,
On Fri, Sep 08, 2023 at 09:51:35AM +0200, Philippe Mathieu-Daudé wrote:
> On 7/9/23 20:17, Victor Toso wrote:
> > Hi,
>
> > >File "/home/berrange/src/virt/qemu/scripts/qapi/dumpexamples.py", line
> > > 118, in parse_examples_o
Hi,
On Thu, Sep 14, 2023 at 03:50:23PM +0200, Markus Armbruster wrote:
> Victor Toso writes:
>
> > Example output has a comment embedded in the array. Remove it.
> > The end result is a list of size 1.
> >
> > Signed-off-by: Victor Toso
> > ---
> > qa
The next patch adds a generator that also validates qapi
documentation. We don't want to execute it with a test schema.
Signed-off-by: Victor Toso
---
scripts/qapi/main.py | 4
tests/meson.build| 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi/main
into "sequence-order". A language binding project can then
consume this files to Marshal and Unmarshal, comparing if the results
are what is to be expected.
RFC discussion:
https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04641.html
Signed-off-by: Victor Toso
---
scripts/qapi
2023 at 01:13:23PM +0200, Victor Toso wrote:
> The next patch adds a generator that also validates qapi
> documentation. We don't want to execute it with a test schema.
>
> Signed-off-by: Victor Toso
> ---
> scripts/qapi/main.py | 4
> tests/meson.build| 2 +-
&g
1 - 100 of 292 matches
Mail list logo