golang/xenlight: Errors are negative
authorGeorge Dunlap <george.dunlap@citrix.com>
Thu, 26 Dec 2019 17:18:14 +0000 (17:18 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 21 Jan 2020 17:48:24 +0000 (17:48 +0000)
commit8ea9f5c56c0dfdd8089718fb86541b6025638328
treeb962b31b8cb2907e7a6631e54fe44907bac1225e
parentb16f51ea8a59d85cf424494d8e9648df6c93d365
golang/xenlight: Errors are negative

Commit 871e51d2d4 changed the sign on the xenlight error types (making
the values negative, same as the C-generated constants), but failed to
flip the sign in the Error() string function.  The result is that
ErrorNonspecific.String() prints "libxl error: 1" rather than the
human-readable error message.

Get rid of the whole issue by making libxlErrors a map, and mapping
actual error values to string, falling back to printing the actual
value of the Error type if it's not present.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Nick Rosbrook <rosbrookn@ainfosec.com>
tools/golang/xenlight/xenlight.go