Re: [Xen-devel] [PATCH v2] golang/xenlight: implement constructor generation

2020-03-09 Thread George Dunlap
On 3/2/20 8:10 PM, Nick Rosbrook wrote: > Generate constructors for generated Go types. Call libxl__init so > the Go type can be properly initialized. > > If a type has a keyed union field, add a parameter to the function > signature to set the key variable, and call the init function for the > ke

Re: [Xen-devel] [PATCH v2] golang/xenlight: implement constructor generation

2020-03-05 Thread Nick Rosbrook
> NewDomainConfig() as of this patch can never return success, because > DomainConfig.fromC() will call DomainBuildInfo.fromC(), which will choke > on b_info.type = LIBXL_DOMAIN_TYPE_INVALID. > > This is actually a bug in to/fromC. Consider libxl_channelinfo. > > The idl says: > > libxl_channelinf

Re: [Xen-devel] [PATCH v2] golang/xenlight: implement constructor generation

2020-03-05 Thread Nick Rosbrook
> Although, I'm not sure if that implies "There's already boilerplate, so > it's extra important to avoid adding more", or "There's already > boilerplate, so it won't hurt to have a bit more, and wrap the whole > thing in a nicer library." I think the boilerplate added here is necessary. We need t

Re: [Xen-devel] [PATCH v2] golang/xenlight: implement constructor generation

2020-03-05 Thread George Dunlap
On 3/4/20 6:08 PM, George Dunlap wrote: > On 3/2/20 8:10 PM, Nick Rosbrook wrote: >> Generate constructors for generated Go types. Call libxl__init so >> the Go type can be properly initialized. >> >> If a type has a keyed union field, add a parameter to the function >> signature to set the key var

Re: [Xen-devel] [PATCH v2] golang/xenlight: implement constructor generation

2020-03-04 Thread George Dunlap
On 3/2/20 8:10 PM, Nick Rosbrook wrote: > Generate constructors for generated Go types. Call libxl__init so > the Go type can be properly initialized. > > If a type has a keyed union field, add a parameter to the function > signature to set the key variable, and call the init function for the > ke

Re: [Xen-devel] [PATCH v2] golang/xenlight: implement constructor generation

2020-03-02 Thread Nick Rosbrook
> Generate constructors for generated Go types. Call libxl__init so > the Go type can be properly initialized. > > If a type has a keyed union field, add a parameter to the function > signature to set the key variable, and call the init function for the > keyed union. > > Signed-off-by: Nick Rosbro

[Xen-devel] [PATCH v2] golang/xenlight: implement constructor generation

2020-03-02 Thread Nick Rosbrook
Generate constructors for generated Go types. Call libxl__init so the Go type can be properly initialized. If a type has a keyed union field, add a parameter to the function signature to set the key variable, and call the init function for the keyed union. Signed-off-by: Nick Rosbrook --- tools