Re: [RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 01:28:39PM +0200, Victor Toso wrote: > Hi, > > On Tue, May 10, 2022 at 12:19:57PM +0100, Daniel P. Berrangé wrote: > > > Marshalling does error if you try to convert an int that is not > > > in the range of the enum type. > > > > > > Unmarshalling should not error in this

Re: [RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go

2022-05-10 Thread Victor Toso
Hi, On Tue, May 10, 2022 at 12:19:57PM +0100, Daniel P. Berrangé wrote: > > Marshalling does error if you try to convert an int that is not > > in the range of the enum type. > > > > Unmarshalling should not error in this case, but the field ends > > up not being set which defaults to 0 (in this

Re: [RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go

2022-05-10 Thread Daniel P . Berrangé
On Tue, May 10, 2022 at 01:15:32PM +0200, Victor Toso wrote: > Hi, > > On Tue, May 10, 2022 at 11:06:16AM +0100, Daniel P. Berrangé wrote: > > On Sat, Apr 02, 2022 at 12:40:57AM +0200, Victor Toso wrote: > > > This patch handles QAPI enum types and generates its equivalent in Go. > > > > > > The

Re: [RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go

2022-05-10 Thread Victor Toso
Hi, On Tue, May 10, 2022 at 11:06:16AM +0100, Daniel P. Berrangé wrote: > On Sat, Apr 02, 2022 at 12:40:57AM +0200, Victor Toso wrote: > > This patch handles QAPI enum types and generates its equivalent in Go. > > > > The highlights of this implementation are: > > > > 1. For each QAPI enum, we w

Re: [RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go

2022-05-10 Thread Daniel P . Berrangé
On Sat, Apr 02, 2022 at 12:40:57AM +0200, Victor Toso wrote: > This patch handles QAPI enum types and generates its equivalent in Go. > > The highlights of this implementation are: > > 1. For each QAPI enum, we will define an int32 type in Go to be the >assigned type of this specific enum I

[RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go

2022-04-01 Thread Victor Toso
This patch handles QAPI enum types and generates its equivalent in Go. The highlights of this implementation are: 1. For each QAPI enum, we will define an int32 type in Go to be the assigned type of this specific enum 2. While in the Go codebase we can use the generated enum values, the sp