CP-8988: Remove xenguest from source tree

This component is now part of ocaml-xen-lowlevel-libs.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>

Conflicts:
	setup.ml
CP-8988: Add support for legacy (pre Xen 4.5) Libxc

Currently* libxc's xc_domain_save will save just the memory image and expect
the toolstack to save the device model record but xc_domain_restore will
consume the device_model_record too. We need to detect whether we are running
in this environment and handle it as a special case.

* This should hopefully not be the case for much longer. There has started an
effort to upstream some patches to libxc to formalise a memory image protocol
and make the handling of the device model record symmetric across save/restore.
These should be in Xen 4.5.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-8988: Check for existence of suspend image conversion script

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-8987: Use Sexp for Xenops header serialisation

We want to be able to extend the Xenops record in the suspend image in future
versions. We therefore require a serialisation format that supports optional
parsing. Sexplib has such functionality with sexp_option allowing us to add new
fields to new versions and still parse older versions with these defaulting to
None.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-8987: Add domain's Xenstore tree to the Xenops suspend record

Add everything under /local/domain/<domid>/ to the suspend image as part of the
Xenops metadata record.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-8987: Serialise Xenops VM record into suspend image

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CP-8987: Don't log Xenops suspend image record contents

It is too large to log when reading and writing but will be of use when
inspecing a suspend image.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #86 from simonjbeaumont/migv2-oss-compat

CP-8988: Support environments without suspend image conversion tools
Merge pull request #87 from simonjbeaumont/migv2-metadata

CP-8987: Support extensible Xenops suspend image records
CA-140974: Only attempt one bind per host at a time

If multiple VMs with vGPUs are starting in parallel, there is the
possibility that one thread will see that a GPU is not yet bound to the
NVIDIA driver while another thread is already attempting to bind the
GPU. The second thread will then also attempt to bind the device, which
will fail with ENODEV.

Moving the mutex to the top level of the bind function means that each
thread will only check the status of a device after any other threads
have finished binding it.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #89 from johnelse/ca-140974

CA-140974: Only attempt one bind per host at a time
CP-8987: Deserialise the Xenops record on restore

We want to make sure we're receiving a valid suspend image so, as well as
reading in the right amount of length for the record (checking that the
macro-structure of the suspend image is correct), we should also attempt to
deserialise the Xenops_record to check that it is valid on a deeper level. For
now, we are not doing anything with it but the deserialisation alone checks the
validity.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #90 from simonjbeaumont/migv2-metadata

CP-8987: Deserialise the Xenops record on restore