Re: [PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-10-04 Thread Victor Toso
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:50PM +0100, Daniel P. Berrangé wrote: > > > > On W

Re: [PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-10-04 Thread Victor Toso
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 Union but without a discriminator tha

Re: [PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-10-02 Thread John Snow
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:50PM +0100, Daniel P. Berrangé wrote: > > > On Wed, Sep 27, 2023 at 01:25:37PM +0200, Victor Toso wrote: > > > > This patch handl

Re: [PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-10-02 Thread John Snow
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 Union but without a discriminator that > can be used to identify the underlying value on the wire. It is needed >

Re: [PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-09-29 Thread Daniel P . Berrangé
On Fri, Sep 29, 2023 at 02:23:22PM +0200, Victor Toso wrote: > 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 h

Re: [PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-09-29 Thread Victor Toso
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) needs some imports added. > I

Re: [PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-09-28 Thread Daniel P . Berrangé
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) needs some imports added. I found the following to be required in order to actually compile this: alternates.go

[PATCH v1 2/9] qapi: golang: Generate qapi's alternate types in Go

2023-09-27 Thread Victor Toso
This patch handles QAPI alternate types and generates data structures in Go that handles it. Alternate types are similar to Union but without a discriminator that can be used to identify the underlying value on the wire. It is needed to infer it. In Go, most of the types [*] are mapped as optional