CA-142107: Enable verbose logging for convert-legacy-stream

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-142107: Log arguments before spawning convert-legacy-stream

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
xenlight: replace hardcoded paths

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: add some additional debug lines

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: use an asynchronous way to report the outcome of asynchronous libxl calls

Sometimes an asynchronous libxl call may return and call back before the
initiating function returns. When this happens, the callback occurs on the same
thread as the initiating function and must not block.

We used to use the synchronous Event module to pass the result from the
callback back to the initiator, which does not work in this case. We replace it
by a custom event module with blocking reads and non-blocking writes.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #111 from robhoes/xl-sync

Some further libxl backend tweaks
CP-9227: Safeguard against malicious suspend images

During VM.resume, as part of Domain.restore in Xenopsd, when a Qemu record in
the suspend image is detected, the header is parsed (with a length) and then
this number of bytes is written out to a file in dom0's filesystem to be passed
to Qemu.

This patch:
* Catches any error that may occur when writing the file for qemu.
* Puts some sanity checks when parsing the length in the Qemu record header.
  This should be large enough that we won't need to change it if/when we
  upgrade Qemu to future versions but small enough to avoid a DoS. Qemu save
  records are currently around 7-8k. We have chosen to read a max of 1M and
  raise an exception if we parse a suspend image that claims to have a Qemu
  record bigger than this.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #112 from robhoes/safe-resume

CP-9227: Safeguard against malicious suspend images
CP-9366: Watch the "control" xenstore node

Now when qemu writes a feature-flag into the control node, xenopsd/xapi will
notice and so will trigger the existing code that can copy those entries
into the "other" vm guest metrics parameter.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CP-9366: Allow vCPU hotplug for HVM (if feature-vcpu-hotplug is set).

Removed code that raises an Unimplemented exception unconditionally
for hvm guests when attempting vCPU hotplug.
This allows the existing code that decides based on the feature-flag
to work properly.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #113 from robhoes/hvmlinux

CP-9366: Use HVM feature-flags instead of checking PV drivers
libvirt: suppress warnings

Signed-off-by: David Scott <dave.scott@citrix.com>
Makefile: update following transition to OASIS

Fixes #106

Signed-off-by: David Scott <dave.scott@citrix.com>
By default use the upstream qemu

Upstream qemu is what upstream xen which us to use. People who still
wish to use 'traditional' can change the config file (and ensure they
have a suitable binary)

Signed-off-by: David Scott <dave.scott@citrix.com>
CA-141856: Preserve update barrier ordering

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
xenlight: binary is xenops_xl_main.native (-> xenopsd-xl)

Signed-off-by: David Scott <dave.scott@citrix.com>
Document a few missing options in the .conf file

Signed-off-by: David Scott <dave.scott@citrix.com>
make install: fix the config file creator

Signed-off-by: David Scott <dave.scott@citrix.com>
Merge pull request #116 from simonjbeaumont/ca-141856

CA-141856: Preserve update barrier ordering
libvirt: add type annotations to improve safety

let _ = ... is a bit dangerous if we need the side-effects of ...

Signed-off-by: David Scott <dave.scott@citrix.com>