Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-06-01 Thread Victor Toso
Hi, On Wed, May 25, 2022 at 08:49:19AM -0500, Andrea Bolognani wrote: > On Wed, May 18, 2022 at 02:30:11PM +0200, Markus Armbruster wrote: > > Victor Toso writes: > > > IMHO, at this moment, qapi-go is targeting communicating with > > > QEMU and handling multiple QEMU versions seems reasonable

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-25 Thread Markus Armbruster
Andrea Bolognani writes: > On Wed, May 18, 2022 at 02:30:11PM +0200, Markus Armbruster wrote: >> Victor Toso writes: >> > IMHO, at this moment, qapi-go is targeting communicating with >> > QEMU and handling multiple QEMU versions seems reasonable to me. >> >> It's targeting communicating in

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-25 Thread Andrea Bolognani
On Wed, May 18, 2022 at 02:30:11PM +0200, Markus Armbruster wrote: > Victor Toso writes: > > IMHO, at this moment, qapi-go is targeting communicating with > > QEMU and handling multiple QEMU versions seems reasonable to me. > > It's targeting communicating in *QMP*. QMP is designed to support >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-18 Thread Markus Armbruster
Victor Toso writes: > Hi, > > On Wed, May 11, 2022 at 04:17:35PM +0200, Markus Armbruster wrote: >> Daniel P. Berrangé writes: >> > Caller >> > >> > block_resize(device="dev0", size=1*GiB) >> > block_resize(node_name="devnode0", size=1*GiB) >> > >> > >> > In golang definition >> > >> >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-18 Thread Victor Toso
HI, On Wed, May 18, 2022 at 09:51:56AM +0100, Daniel P. Berrangé wrote: > On Wed, May 18, 2022 at 10:10:48AM +0200, Victor Toso wrote: > > Hi, > > > > On Wed, May 11, 2022 at 04:50:35PM +0100, Daniel P. Berrangé wrote: > > > On Wed, May 11, 2022 at 08:38:04AM -0700, Andrea Bolognani wrote: > > >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-18 Thread Victor Toso
Hi, On Wed, May 11, 2022 at 04:17:35PM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > Caller > > > > block_resize(device="dev0", size=1*GiB) > > block_resize(node_name="devnode0", size=1*GiB) > > > > > > In golang definition > > > >type BlockResizeArguments struct {

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-18 Thread Daniel P . Berrangé
On Wed, May 18, 2022 at 10:10:48AM +0200, Victor Toso wrote: > Hi, > > On Wed, May 11, 2022 at 04:50:35PM +0100, Daniel P. Berrangé wrote: > > On Wed, May 11, 2022 at 08:38:04AM -0700, Andrea Bolognani wrote: > > > On Tue, May 10, 2022 at 01:51:05PM +0100, Daniel P. Berrangé wrote: > > > > In

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-18 Thread Victor Toso
Hi, On Wed, May 11, 2022 at 04:50:35PM +0100, Daniel P. Berrangé wrote: > On Wed, May 11, 2022 at 08:38:04AM -0700, Andrea Bolognani wrote: > > On Tue, May 10, 2022 at 01:51:05PM +0100, Daniel P. Berrangé wrote: > > > In 7.0.0 we can now generate > > > > > >type BlockResizeArguments struct {

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Daniel P . Berrangé
On Wed, May 11, 2022 at 09:22:36AM -0700, Andrea Bolognani wrote: > On Wed, May 11, 2022 at 04:50:35PM +0100, Daniel P. Berrangé wrote: > > This would lead to a situation where every struct is duplicated > > for every version, even though 90% of the time they'll be identical > > across multiple

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Andrea Bolognani
On Wed, May 11, 2022 at 04:50:35PM +0100, Daniel P. Berrangé wrote: > This would lead to a situation where every struct is duplicated > for every version, even though 90% of the time they'll be identical > across multiple versions. This is not very ammenable to the desire > to be able to

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Daniel P . Berrangé
On Wed, May 11, 2022 at 08:38:04AM -0700, Andrea Bolognani wrote: > On Tue, May 10, 2022 at 01:51:05PM +0100, Daniel P. Berrangé wrote: > > In 7.0.0 we can now generate > > > >type BlockResizeArguments struct { > >V500 *BlockResizeArgumentsV500 > >V520 *BlockResizeArgumentsV520

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Andrea Bolognani
On Tue, May 10, 2022 at 01:51:05PM +0100, Daniel P. Berrangé wrote: > In 7.0.0 we can now generate > >type BlockResizeArguments struct { >V500 *BlockResizeArgumentsV500 >V520 *BlockResizeArgumentsV520 >V700 *BlockResizeArgumentsV700 >} > >type

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Daniel P . Berrangé
On Wed, May 11, 2022 at 04:17:43PM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Tue, May 10, 2022 at 01:34:03PM +0100, Daniel P. Berrangé wrote: > > Having said that, a different way to approach the problem is to expose > > the versioning directly in the generated code.

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, May 10, 2022 at 02:02:56PM +0200, Markus Armbruster wrote: >> Daniel P. Berrangé writes: >> >> > On Tue, Apr 26, 2022 at 01:14:28PM +0200, Markus Armbruster wrote: >> >> We need to look at "following the QEMU releases" a bit more closely. >> >> >> >>

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, May 10, 2022 at 01:34:03PM +0100, Daniel P. Berrangé wrote: >> On Tue, May 10, 2022 at 02:02:56PM +0200, Markus Armbruster wrote: >> > > For a minimum viable use case, this doesn't feel all that difficult, as >> > > conceptually instead of deleting the field

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Mon, May 02, 2022 at 10:01:41AM -0400, Andrea Bolognani wrote: >> > Times how many naming conventions? >> >> Yeah, I don't think requiring all possible permutations to be spelled >> out in the schema is the way to go. That's exactly why my proposal >> was to

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-11 Thread Markus Armbruster
Andrea Bolognani writes: > On Tue, May 03, 2022 at 09:57:27AM +0200, Markus Armbruster wrote: >> Andrea Bolognani writes: >> > I still feel that 1) users of a language SDK will ideally not need to >> > look at the QAPI schema or wire chatter too often >> >> I think the most likely point of

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 01:37:50PM -0400, Andrea Bolognani wrote: > On Mon, May 09, 2022 at 12:21:10PM +0200, Victor Toso wrote: > > On Tue, Apr 19, 2022 at 11:12:28AM -0700, Andrea Bolognani wrote: > > > Based on the example you have in the README and how commands are > > > defined, invoking (a

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Andrea Bolognani
On Mon, May 09, 2022 at 12:21:10PM +0200, Victor Toso wrote: > On Tue, Apr 19, 2022 at 11:12:28AM -0700, Andrea Bolognani wrote: > > Based on the example you have in the README and how commands are > > defined, invoking (a simplified version of) the trace-event-get-state > > command would look

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Andrea Bolognani
On Tue, May 10, 2022 at 10:52:34AM +0100, Daniel P. Berrangé wrote: > On Mon, May 02, 2022 at 10:01:41AM -0400, Andrea Bolognani wrote: > > Revised proposal for the annotation: > > > > ns:word-WORD-WoRD-123Word > > Ugly, but we should only need this in the fairly niche scenarios, > so not too

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 01:34:03PM +0100, Daniel P. Berrangé wrote: > On Tue, May 10, 2022 at 02:02:56PM +0200, Markus Armbruster wrote: > > > For a minimum viable use case, this doesn't feel all that difficult, as > > > conceptually instead of deleting the field from QAPI, we just need to > > >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 02:02:56PM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Tue, Apr 26, 2022 at 01:14:28PM +0200, Markus Armbruster wrote: > >> We need to look at "following the QEMU releases" a bit more closely. > >> > >> Merging your patches gives us the

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, Apr 26, 2022 at 01:14:28PM +0200, Markus Armbruster wrote: >> Victor Toso writes: >> >> > Hi, >> > >> > Happy 1st April. Not a joke :) /* ugh, took me too long to send */ >> > >> > This series is about adding a generator in scripts/qapi to produce >> > Go

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Victor Toso
Hi, On Tue, May 10, 2022 at 10:06:34AM +0200, Markus Armbruster wrote: > Victor Toso writes: > >> That's true, but at least to me the trade-off feels reasonable. > > > > I don't quite get the argument why it gets harder to find. We can > > simply provide the actual name as reference in the

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 12:50:47PM +0200, Victor Toso wrote: > Hi, > > On Tue, May 10, 2022 at 10:32:49AM +0100, Daniel P. Berrangé wrote: > > On Tue, May 10, 2022 at 10:18:15AM +0100, Daniel P. Berrangé wrote: > > > On Tue, May 10, 2022 at 11:06:39AM +0200, Victor Toso wrote: > > > > > > >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Victor Toso
Hi, On Tue, May 10, 2022 at 10:32:49AM +0100, Daniel P. Berrangé wrote: > On Tue, May 10, 2022 at 10:18:15AM +0100, Daniel P. Berrangé wrote: > > On Tue, May 10, 2022 at 11:06:39AM +0200, Victor Toso wrote: > > > > > > generated code needs to be compatible with other Golang projects, > > > > > >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Sat, Apr 02, 2022 at 12:40:56AM +0200, Victor Toso wrote: > * Status > > There are a few rough edges to work on but this is usable. The major > thing I forgot to add is handling Error from Commands. It'll be the > first thing I'll work on next week. > > If you want to start using this Today

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 10:18:15AM +0100, Daniel P. Berrangé wrote: > On Tue, May 10, 2022 at 11:06:39AM +0200, Victor Toso wrote: > > Hi, > > > > On Tue, May 10, 2022 at 09:53:05AM +0100, Daniel P. Berrangé wrote: > > > > > * License > > > > > > > > > > While the generator (golang.py in this

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 03, 2022 at 02:40:14AM -0700, Andrea Bolognani wrote: > On Tue, May 03, 2022 at 09:57:27AM +0200, Markus Armbruster wrote: > > Andrea Bolognani writes: > > > I still feel that 1) users of a language SDK will ideally not need to > > > look at the QAPI schema or wire chatter too often >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Mon, May 02, 2022 at 10:01:41AM -0400, Andrea Bolognani wrote: > > Times how many naming conventions? > > Yeah, I don't think requiring all possible permutations to be spelled > out in the schema is the way to go. That's exactly why my proposal > was to offer a way to inject the semantic

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 11:06:39AM +0200, Victor Toso wrote: > Hi, > > On Tue, May 10, 2022 at 09:53:05AM +0100, Daniel P. Berrangé wrote: > > > > * License > > > > > > > > While the generator (golang.py in this series) is GPL v2, the > > > > > > I'd make it v2+, just to express my displeasure

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Victor Toso
Hi, On Tue, May 10, 2022 at 09:53:05AM +0100, Daniel P. Berrangé wrote: > > > * License > > > > > > While the generator (golang.py in this series) is GPL v2, the > > > > I'd make it v2+, just to express my displeasure with the decision to > > make the initial QAPI generator v2 only for no good

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Daniel P . Berrangé
On Tue, Apr 26, 2022 at 01:14:28PM +0200, Markus Armbruster wrote: > Victor Toso writes: > > > Hi, > > > > Happy 1st April. Not a joke :) /* ugh, took me too long to send */ > > > > This series is about adding a generator in scripts/qapi to produce > > Go data structures that can be used to

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-10 Thread Markus Armbruster
Victor Toso writes: > Hi, > > On Mon, May 02, 2022 at 10:01:41AM -0400, Andrea Bolognani wrote: >> On Mon, May 02, 2022 at 01:46:23PM +0200, Markus Armbruster wrote: >> > Andrea Bolognani writes: >> > >> > The wire protocol would still retain the unappealing >> > >> > name, but at least client

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-09 Thread Victor Toso
Hi, On Mon, May 02, 2022 at 10:01:41AM -0400, Andrea Bolognani wrote: > On Mon, May 02, 2022 at 01:46:23PM +0200, Markus Armbruster wrote: > > Andrea Bolognani writes: > > >> > The wire protocol would still retain the unappealing > > >> > name, but at least client libraries could hide the > > >>

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-09 Thread Victor Toso
Hi, Thanks for the quick review Markus. Sorry for taking quite a bit of time to get back to you. On Tue, Apr 26, 2022 at 01:14:28PM +0200, Markus Armbruster wrote: > Victor Toso writes: > > > Hi, > > > > Happy 1st April. Not a joke :) /* ugh, took me too long to send */ > > > > This series is

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-09 Thread Victor Toso
Hi! Sorry for taking some time to reply. On Tue, Apr 19, 2022 at 11:12:28AM -0700, Andrea Bolognani wrote: > On Sat, Apr 02, 2022 at 12:40:56AM +0200, Victor Toso wrote: > > Thanks for taking a look, let me know if you have questions, ideas > > or suggestions. > > Full disclosure: I have only

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-03 Thread Kevin Wolf
Am 03.05.2022 um 11:40 hat Andrea Bolognani geschrieben: > So the issues preventing us from producing a "perfect" Go API are > > 1. inconsistent capitalization in type names > >-> could be addressed by simply changing the schema, as type > names do not travel on the wire > > 2.

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-03 Thread Andrea Bolognani
On Tue, May 03, 2022 at 09:57:27AM +0200, Markus Armbruster wrote: > Andrea Bolognani writes: > > I still feel that 1) users of a language SDK will ideally not need to > > look at the QAPI schema or wire chatter too often > > I think the most likely point of contact is the QEMU QMP Reference >

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-03 Thread Markus Armbruster
Andrea Bolognani writes: > On Mon, May 02, 2022 at 01:46:23PM +0200, Markus Armbruster wrote: >> Andrea Bolognani writes: >> >> > The wire protocol would still retain the unappealing name, but at >> >> > least client libraries could hide the uglyness from users. >> >> >> >> At the price of mild

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-02 Thread Andrea Bolognani
On Mon, May 02, 2022 at 01:46:23PM +0200, Markus Armbruster wrote: > Andrea Bolognani writes: > >> > The wire protocol would still retain the unappealing name, but at > >> > least client libraries could hide the uglyness from users. > >> > >> At the price of mild inconsistency between the library

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-02 Thread Markus Armbruster
Andrea Bolognani writes: > On Mon, May 02, 2022 at 09:21:36AM +0200, Markus Armbruster wrote: >> Andrea Bolognani writes: >> > The wire protocol would still retain the unappealing name, but at >> > least client libraries could hide the uglyness from users. >> >> At the price of mild

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-02 Thread Andrea Bolognani
On Mon, May 02, 2022 at 09:21:36AM +0200, Markus Armbruster wrote: > Andrea Bolognani writes: > > The wire protocol would still retain the unappealing name, but at > > least client libraries could hide the uglyness from users. > > At the price of mild inconsistency between the library interface

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-05-02 Thread Markus Armbruster
Andrea Bolognani writes: > On Thu, Apr 28, 2022 at 03:50:55PM +0200, Markus Armbruster wrote: >> Andrea Bolognani writes: >> > One concern that I have is about naming struct members: things like >> > SpiceInfo.MouseMode and most others are translated from the QAPI >> > schema exactly the way

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-04-29 Thread Andrea Bolognani
On Thu, Apr 28, 2022 at 03:50:55PM +0200, Markus Armbruster wrote: > Andrea Bolognani writes: > > One concern that I have is about naming struct members: things like > > SpiceInfo.MouseMode and most others are translated from the QAPI > > schema exactly the way you'd expect them, but for example

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-04-28 Thread Markus Armbruster
Andrea Bolognani writes: > On Sat, Apr 02, 2022 at 12:40:56AM +0200, Victor Toso wrote: >> Thanks for taking a look, let me know if you have questions, ideas >> or suggestions. > > Full disclosure: I have only given the actual implementation a very > cursory look so far, and I've focused on the

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-04-26 Thread Markus Armbruster
Victor Toso writes: > Hi, > > Happy 1st April. Not a joke :) /* ugh, took me too long to send */ > > This series is about adding a generator in scripts/qapi to produce > Go data structures that can be used to communicate with QEMU over > QMP. > > > * Why Go? > > There are quite a few Go projects

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-04-19 Thread Andrea Bolognani
On Tue, Apr 19, 2022 at 11:12:28AM -0700, Andrea Bolognani wrote: > Dealing with errors and commands that don't have a return value might > require us to have generic CommandResult wrapper after all, but we > should really try as hard as we can to stick to type safe interfaces. On second thought,

Re: [RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-04-19 Thread Andrea Bolognani
On Sat, Apr 02, 2022 at 12:40:56AM +0200, Victor Toso wrote: > Thanks for taking a look, let me know if you have questions, ideas > or suggestions. Full disclosure: I have only given the actual implementation a very cursory look so far, and I've focused on the generated Go API instead. Overall

[RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-04-01 Thread Victor Toso
Hi, Happy 1st April. Not a joke :) /* ugh, took me too long to send */ This series is about adding a generator in scripts/qapi to produce Go data structures that can be used to communicate with QEMU over QMP. * Why Go? There are quite a few Go projects that interact with QEMU over QMP and