CA-102759: loosen HA restriction on expired hosts

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
CA-105160: Make sure event_wait is cancellable

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-105159: Wait for ack of shutdown request for HVM guests with PV drivers

The code paths only handled fully-PV guests and HVM guests without PV drivers.
In the case of PV drivers we did not wait for the shutdown request to be
acknowledged. This did not enable early exit if the request was not
acknowledged.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-105155: Make sure we timeout as requested

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Make VM.shutdown timeout configurable.

The default remains at 1200.0

Configure by creating/editing a file /etc/xensource/xapi_globs.conf
and put in the line:

domain_shutdown_total_timeout = 30.0

for example.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Make it such that you can do a hard_shutdown even if a clean_shutdown is in progress

Same for reboot

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
SCTX-1334: Ensure that a force shutdown cancels any clean_shutdown.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-105793: Don't ignore the shutdown_delay parameter.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
SCTX-1334: Add exception handlers

In response to code review with djs55

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Raise the correct error if a xenops task is cancelled

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-104869: Generation-id value incorrect when prepended with leading zeros.

Signed-off-by: Akshay Ramani <akshay.ramani@citrix.com>
Merge pull request #1199 from jonludlam/SCTX-1334

SCTX-1334 - reviewed by @djs55
Merge pull request #1214 from akshayramani/CA-104869

CA-104869: Generation-id value incorrect when prepended with leading zer...
Remove unecessary comment after code change
CA-105003: Handle exceptions in get_shadow_allocation.

This fails when the VM has no VCPUs, which has been observed in
the wild. Also contains a workaround for CA-104562 by preventing
bizarrely large values being set.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #1215 from jonludlam/CA-105003

CA-105003: Handle exceptions in get_shadow_allocation.
CA-95053: VM.start should check if a host has enough memory

Though it should fall back to just trying anyway in case of
failure as memory checks are notoriously hard to get right.

This patch is based on a similar one by Jerome Maloberti.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #1216 from jonludlam/CA-95053-v2

CA-95053: VM.start should check if a host has enough memory
Merge pull request #1184 from zli/xenserver/CA-102759

CA-102759: loosen HA restriction on expired hosts