Re: [Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-12-06 Thread Nick Rosbrook
> OK. FYI I'm going to have to stop reviewing here for a bit; if you > re-send the series with the comments on 1-16 addressed though, I'll skim > through and check it in if it looks good. Okay, thanks for the heads up. I'm hoping to send v3 in the next few days. -NR

Re: [Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-12-06 Thread George Dunlap
On 12/5/19 6:39 PM, Nick Rosbrook wrote: >> It actually occurs to me that the "named struct elements of union" would >> still technically open up a window for divergence: i.e., if somehow the >> type of the named struct didn't match up with the union element. >> >> I.e., the following *shouldn't*

Re: [Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-12-05 Thread Nick Rosbrook
> It actually occurs to me that the "named struct elements of union" would > still technically open up a window for divergence: i.e., if somehow the > type of the named struct didn't match up with the union element. > > I.e., the following *shouldn't* happen, but technically it *could*: > > >

Re: [Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-12-05 Thread George Dunlap
On 12/5/19 4:53 PM, Nick Rosbrook wrote: >>> It looks like this is duplicating (differently!) the field-copying code >>> from golang_define_from_C. Is there any reason you couldn't have a >>> single function, `xenlight_golang_fields_from_C`, which would be used >>> for both? > > No, I should be

Re: [Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-12-05 Thread Nick Rosbrook
> > It looks like this is duplicating (differently!) the field-copying code > > from golang_define_from_C. Is there any reason you couldn't have a > > single function, `xenlight_golang_fields_from_C`, which would be used > > for both? No, I should be able to re-factor that. Thanks. > Actually,

Re: [Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-12-05 Thread George Dunlap
On 12/4/19 6:40 PM, George Dunlap wrote: > On 11/15/19 7:44 PM, Nick Rosbrook wrote: >> From: Nick Rosbrook >> >> Switch over union key to determine how to populate 'union' in Go struct. >> >> Since the unions of C types cannot be directly accessed, add C structs in >> cgo preamble to assist in

Re: [Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-12-04 Thread George Dunlap
On 11/15/19 7:44 PM, Nick Rosbrook wrote: > From: Nick Rosbrook > > Switch over union key to determine how to populate 'union' in Go struct. > > Since the unions of C types cannot be directly accessed, add C structs in > cgo preamble to assist in marshaling keyed unions. This allows the C >

[Xen-devel] [PATCH v2 16/22] golang/xenlight: implement keyed union C to Go marshaling

2019-11-15 Thread Nick Rosbrook
From: Nick Rosbrook Switch over union key to determine how to populate 'union' in Go struct. Since the unions of C types cannot be directly accessed, add C structs in cgo preamble to assist in marshaling keyed unions. This allows the C type defined in the preamble to be populated first, and