CP-9366: Watch the "control" xenstore node, and update VM-metrics "other".

Now when qemu writes a feature-flag into the control node, xapi will
notice and so will trigger the existing code that can copy those entries
into the "other" vm guest metrics parameter.

That code used to do nothing unless it found a version for the PV
drivers. These are absent for HVM Linux guests with no guest agent, so
now even if there is no PV driver version we do the minimum work
needed to update "other", including creating the VM guest metrics
record if needed.

Also, now we set the guest metrics record to null on VM start.
This avoids problems of some of its data being wrong (left over from
last time the VM ran, or from the VM's parent if it is a clone) but
being trusted because its last_updated is more recent than VM start
time due to an item in "other" being set before (say) the networks
field is updated.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
CP-9366: Check HVM feature-flags not just PV drivers

Use these flags to determine the allowed_operations list which is
only advisory.  When it comes to attempting an operation, do not
require the feature-suspend or feature-shutdown flag: attempt the
operation anyway and it is up to the guest whether it cooperates.
The feature-vcpu-hotplug flag is needed for that operation though.

Changes:
* xapi_vm_lifecycle check_operation_error uses the flags to check
  whether we can perform a given operation. (Also checks for PV
  drivers to support old guest agents that do not write the flags.)
* In xapi_host.ml the pre-evacuation check no longer checks for PV
  drivers to learn whether a VM can be migrated.  It was already
  calling Xapi_vm_lifecycle.get_operation_error.
* Appropriate errors are defined: one for each of three features.
* Datamodel: removed vm_missing_pv_drivers from vm_pool_migrate
  error list
* Removed code that raises an Unimplemented exception for HVM
  guests when attempting vCPU hotplug. This allows the code that
  decides based on the feature-flag to work properly.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
Merge commit '3e0d55055cc6bf11332b88640e45dd58c01dd3b0'
CP-9366: Require feature-suspend for HVM in host evacuation plan.

CA-146028 should be fixed by this commit.

This reverts part of the behaviour-change (but not code-change) of
my commit 43592b1185789a96ef9728ab761a0940639cc7cf

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
CP-9366: Destroy the VM guest metrics discarded on VM start.

Fix a xapi database leak: on VM start we were just setting the
VM's guest metrics record to Ref.null thus orphaning the old
record.  Now we also destroy it.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
CP-9366: Require HVM feature-flags (or PV drivers) strictly.

When attempting a lifecycle operation on an HVM guest, we now
require any relevant feature-flag (or PV drivers) in the same way
as when calculating the allowed_operations list.

This undoes another part of the behaviour-change (but not
code-change) of my earlier commit
43592b1185789a96ef9728ab761a0940639cc7cf

This returns behaviour for HVM Windows without guest-agent
(without PV drivers) to the same as before any CP-9366 changes.

In a future change we might make this configurable.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
Merge commit 'e965a2ee8c71498ec2bce1cf2b607e8990903ce0'
Merge remote-tracking branch 'creedence/master' into xs64bit-ring3

Merge in the HVM Linux work which was pushed direct to the creedence
branch.