On 12/10/19 3:47 PM, Nick Rosbrook wrote: > From: Nick Rosbrook <rosbro...@ainfosec.com> > > Begin implementation of fromC marshaling functions for generated struct > types. This includes support for converting fields that are basic > primitive types such as string and integer types, nested anonymous > structs, nested libxl structs, and libxl built-in types. > > This patch does not implement conversion of arrays or keyed unions. > > Signed-off-by: Nick Rosbrook <rosbro...@ainfosec.com> > --- > Changes in v2: > - Add Makefile changes for helpers.gen.go. > - Re-generate helpers.gen.go to include libxl changes after rebase. > Changes in v3: > - Break out field copying/type conversion code into its own function > called xenlight_golang_convert_from_C to allow that code to be easily > re-used. > - Use consistent style for calling fromC on struct fields that require > it. Namely, do not use a temporary variable - call fromC directly on > the struct field.
Looks good! One minor comment... > --- > tools/golang/xenlight/Makefile | 2 + > tools/golang/xenlight/gengotypes.py | 118 ++++ > tools/golang/xenlight/helpers.gen.go | 901 +++++++++++++++++++++++++++ > tools/golang/xenlight/xenlight.go | 111 +--- > 4 files changed, 1032 insertions(+), 100 deletions(-) > create mode 100644 tools/golang/xenlight/helpers.gen.go > > diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile > index 681f32c234..07b8896e5b 100644 > --- a/tools/golang/xenlight/Makefile > +++ b/tools/golang/xenlight/Makefile > @@ -19,6 +19,7 @@ $(XEN_GOPATH)/src/$(XEN_GOCODE_URL)/xenlight/: %.gen.go > $(INSTALL_DIR) $(XEN_GOPATH)$(GOXL_PKG_DIR) > $(INSTALL_DATA) xenlight.go $(XEN_GOPATH)$(GOXL_PKG_DIR) > $(INSTALL_DATA) types.gen.go $(XEN_GOPATH)$(GOXL_PKG_DIR) > + $(INSTALL_DATA) helpers.gen.go $(XEN_GOPATH)$(GOXL_PKG_DIR) I'll have to edit this stanza on check-in to depend on helpers.gen.go directly; with that: Reviewed-by: George Dunlap <george.dun...@citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel