On 12/10/19 3:47 PM, Nick Rosbrook wrote: > From: Nick Rosbrook <[email protected]> > > Switch over union key to determine how to populate 'union' in Go struct. > > Since the unions of C types cannot be directly accessed in cgo, use a > typeof trick to typedef a struct in the cgo preamble that is analagous > to each inner struct of a keyed union. For example, to define a struct > for the hvm inner struct of libxl_domain_build_info, do: > > typedef typeof(((struct libxl_domain_build_info *)NULL)->u.hvm) > libxl_domain_build_info_type_union_hvm; > > Signed-off-by: Nick Rosbrook <[email protected]>
Looks great, thanks: Reviewed-by: George Dunlap <[email protected]> _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
