Trim trailing whitespace.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Use a consistent indentation style.

For want of a better standard, use the Xen prefered style.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Conflicts:
	ocaml/xenguest/xenguest_stubs.c
Correct sementics of syslog() calls.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Conflicts:
	ocaml/xenguest/xenguest_stubs.c
Remove use of syslog from the C bindings, replacing them with writes to stdout and stderr. The parent of the xenguest fork is already capturing stdout and stderr from libxc, and will pass them on to syslog. This way, the syslog()'d messages will also find their way into xenguest.$DOMID.log.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Conflicts:
	ocaml/xenguest/xenguest_stubs.c
Open the log file as append rather than write. This saves truncating it in the case of a localhost migrate, loosing the save half of the log.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Make use of /proc/self/

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Implement the save/restore framework for propagaing the Windows Generation ID.

Xenguest being linked directly agianst libxc, the changes are confined to
suitable #ifdefs to allow compilation against multiple versions of Xen.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Conflicts:
	ocaml/xenguest/xenguest_stubs.c
CP-4042: xenguest xenstore changes

Add a xenstore_puts and change xenstore_gets to match trunk's

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

From http://ocamlunix.forge.ocamlcore.org/ocamlunix.html

The flag list must contain exactly one of the following flags:
O_RDONLY	Open in read-only mode.
O_WRONLY	Open in write-only mode.
O_RDWR		Open in read and write mode.

So I've added exactly one of those flags!

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Resolve -Wall errors in xenguest_stubs.c, register local with OCaml GC

Resolved all -Wall errors, except implicit declarations of libxc code which
isn't exported by xenctrl.h.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>

Conflicts:
	ocaml/xenguest/xenguest_stubs.c
Remove duplicate call to Random.self_init in Xapi.server_init

We called both Random.self_init and Random.full_init. Remove self_init in
favour of full_init.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Bump API schema number for augusta

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>

Conflicts:
	ocaml/idl/datamodel.ml
	ocaml/idl/datamodel_types.ml
CP-4042: Add VM.generation-id field to API

Add a new generation-id field to the the API. This field is a string, which
consists of two 64-bit integers concatenated together and separated by ":". We
pass this value directly into the platform map of both PV and HVM guests.
hvmloader takes care of updating the ACPI device. The generation-id will be
updated every time a VM is run "from a different configuration," i.e. when the
VM is imported, reverted from snapshot/checkpoint, cloned/copied, or
disaser-recovered. It is not the generation-id is not updated on normal VM
lifecycle operations, nor is it updated on HA failover.

See the spec here: http://go.microsoft.com/fwlink/?LinkId=260709

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>

Conflicts:
	ocaml/xapi/xapi_vm_clone.ml
	ocaml/xapi/xapi_vm_helpers.ml
CP-4042: Refresh GenID on VM.import, VM.revert

These two operations, along with VM.clone (handled in the previous commit)
cover the rest of the cases specified by the VM Generation ID spec.
Specifically, refreshing on VM.import also covers DR and VM.import, and
VM.revert covers all of the snapshot revert cases (snapshot, snapshot with
quiese, and checkpoint).

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Merge pull request #1166 from jonludlam/cp-4042-clearwater

CLEARWATER: CP-4042