Set avail_vcpus in domain build info

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Fixes for vif locking mode

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
xenlight: use Xenlight defaults wherever we can

When a field is added to a type of the libxl IDL, the Xenlight OCaml bindings
turn this into an additional field in a record type.  This would generally mean
that we would have to change our code to take the new field into account.

However, the bindings provide "default" functions that return records with
libxl's defaults filled into, and all fields present. We can therefore make our
code work without change by getting default records from Xenlight, and using
the "with" syntax to fill in just the fields we need and know.

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

xenlight: use Xenlight defaults wherever we can
xenlight: remove stale debug comments

Comments like these should have never made it upstream... :o)

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: set the network-backend when plugging a VIF

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: don't attempt to destroy stubdoms in VM.destroy

Xenlight will do this for us.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: replace many calls to Xenctrl with ones to Xenlight

The remaining Xenctrl calls (other than those in DEBUG) require corresponding
libxl ocaml bindings to be written, or require new functionality to be added to
libxl itself (shadow_allocation_{get,set}). The remaining Xenctrl calls have
been marked with comments describing this state of affairs.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: remove separate Domain module

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: raise Unimplemented in VM.s3{suspend,resume}

The necessary functions are not yet present in libxl (at least, I could not
find them).

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: replace Xenctrl.domain_setmaxmem with xenlight equivalent

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: remove unused files

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: eliminate most of device.ml

The only things left in device.ml that is needed are to do with vncterm and
some Vbd-related functions. The latter will be removed in a further patch.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: switch *_vbd_frontend functions to libxl

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: remove more of device.ml

The only stuff left in device.ml right now is to do with consoles (vncterm). We
can probably factor this out a bit more, or move away from vncterm altogether,
at some point.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: make the choice of storage backend (qdisk or phy) configurable

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
xenlight: make the choice of QEMU version (upstream or traditional) configurable

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

Lots of cleanup work in the xenlight backend
More fixes for port locking.

The script 'common.py' reads the config from xenopsd's database
directly. The past few commits made sure the on-disk database
was up-to-date after API calls to mutate various fields. However,
there is also some further modification of some of the fields
done by the xc driver - for example, the 'extra_private_fields'
string -> string map is augmented with some extra kvs derived
from other fields. In particular, the ipv4_allowed and
ipv6_allowed keys are derived from the locking_mode parameter.
These keys ended up in xenstore but not in the on-disk
json representation of the VIF. The same happened for the
network-backend field - added by xenopsd to the same map, and
thus not in the on-disk json. This was fixed in a xen-api
commit by explicitly adding it in xapi, which was a bit of
a hack.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Ensure VIF json written to disk before the scripts read it

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>