- Marked all the remaining old APIs from before the code-generator as
deprecated. These will be removed from the go-libvirt library as soon as
we're moved all the DO code over to use the generated APIs.
- Consolidated a couple of APIs whose implementation was split into
multiple files.
- Removed a couple of Migration-related calls we're no longer using.
* Generate the remaining consts.
There were a number of hand-written consts in go-libvirt, including flag
values for various libvirt functions. Remove these and generate them
instead, so that we now have a complete set, and the naming is
consistent. I used c-for-go to do this generation, but turned off any
cgo usage by the generated code - we don't want or need to introduce a
dependency on cgo just to get constants from C headers. All code is
still generated using 'go generate ./...', which now calls a wrapper
script for added robustness.
This change also returns to using Go types for flags for most libvirt
functions, instead of plain integers.
- Update libvirt.go so that all libvirt calls now go through the
generated routines.
- Remove some libvirt routines that had the same name as generated ones,
leave the rest as convenience routines.
- Fix the handling of Optional-values (the declarations of which in the
.x file look like pointers)
The generated wrappers have an argument for every field in their "Args"
struct, and return everything in their "Ret" struct (these structs are
defined in the protocol file, and identified by procedure name).
Marshaling and unmarshaling is handled inside the generated procedures.
* Add Get/SetBlockIoTune to go-libvirt API.
This adds two libvirt entry points to the go-libvirt API:
virDomainSetBlockIoTune and virDomainGetBlockIoTune. These can be used
to control block device throttling for a VM.
This adds basic support for domain migrations from one hypervisor to
another. Migration options, e.g., live, tunneled, compressed, etc..,
are specified by the constants described `constants.Migrate*`.
Two unknowns remain, Libvirt specifies `RemoteParameters` and `CookieIn`.
In testing both values are always set to 0 by `virsh` and the source
does not provide clear definitions of their purpose. For now, using
the same zero'd values used by `virsh` will be Good Enough.
When performing QEMU monitor commands, libvirt will return StatusOK even
when the underlying QEMU process fails to perform the command.
This modifies Run() to check for QEMU errors.
I'm not entirely happy with the hacky modifications to the test library
to handle this scenario. The test framework is in obvious need for a
complete refactor. For now this will have to work.
This splits out the mock libvirt server for testing within
other packages. Constants from the main libvirt package
have been moved to a separate package, constants, for shared access.