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>
Merge pull request #1199 from jonludlam/SCTX-1334

SCTX-1334 - reviewed by @djs55