golang/xenlight: generate enum types from IDL
authorNick Rosbrook <rosbrookn@ainfosec.com>
Mon, 16 Dec 2019 18:07:59 +0000 (18:07 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Mon, 16 Dec 2019 18:07:59 +0000 (18:07 +0000)
commit871e51d2d4378dfe57ebdf5f67196b62484f6743
tree12eb2b8ecb5cb840f0dc08500994259ff3c6ad7c
parent2d696d61452f83c03a38981302efbbea8a7dfc41
golang/xenlight: generate enum types from IDL

Introduce gengotypes.py to generate Go code the from IDL. As a first step,
implement 'enum' type generation.

As a result of the newly-generated code, remove the existing, and now
conflicting definitions in xenlight.go. In the case of the Error type,
rename the slice 'errors' to 'libxlErrors' so that it does not conflict
with the standard library package 'errors.' And, negate the values used
in 'libxlErrors' since the generated error values are negative.

Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
tools/golang/xenlight/Makefile
tools/golang/xenlight/gengotypes.py [new file with mode: 0644]
tools/golang/xenlight/types.gen.go [new file with mode: 0644]
tools/golang/xenlight/xenlight.go