CA-106080: DB upgrade rules update license_params.sku_type

The previous upgrade rules for the DB only modified license_params.edition
(advanced,enterprise,platinum -> per-socket, enterprise-xd -> xendesktop). We
also need to modify sku_type, because v6d will return current_edition =
previous sku_type on the case of an expired license. This is an edge case for
when a license expires just prior to a host upgrade, with no valid licenses on
the license server after upgrade.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
CA-103101: Create a background process from restart_agent to restart the
entire toolstack.
Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Whitespace: Reformat Pool.create_VLAN_from_PIF

$ camlp4o -printer o -no_comments xapi_pool.ml | md5sum
6afb19c9cff915091d37775375954312

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-106560: Create VLANs on slaves that are in 'Maintenance Mode'

Weaken the condition for creating VLANs on slaves during
a Pool.create_VLAN_from_PIF from hosts that are enabled to hosts that are live
(according to the host metrics). This enables the VLAN to be created on slaves
that are in XenCenter's 'Maintenance Mode'.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
CA-101175: Increase timeout for Event.from to 30 seconds, only watch for specific tasks

Signed-off-by: Vincent Bernardoff <vincent.bernardoff@citrix.com>
Using Syslog_stdout for logging
Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Merge pull request #1239 from simonjbeaumont/CA-106560

CA-106560: Create VLANs on slaves that are in 'Maintenance Mode'
CA-106580: suppress debug-level log messages in block_device_io

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #1235 from siddharthv/CA-103101

CA-103101: Create a background process from restart_agent to restart the entire toolstack.
CA-100511: Don't fail SXM when guests are shutdown during migration

If, during the VDI copy to the remote, the guest is shutdown then, when it
comes to moving the domain, Xenops will complain that the domain doesn't exist.
We had already desinged to handle this case but the exception catch needed to
be broadened to match the new "extra" TypedTable used for the VM metadata.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #1247 from robhoes/ca106580

CA-106580: suppress debug-level log messages in block_device_io
Merge pull request #1252 from simonjbeaumont/CA-100511

CA-100511: Don't fail SXM when guests are shutdown during migration
CA-103762: Re-checkout license at expiry

Currently, v6d doesn't have a mechanism for updating xapi with new license
parameters when a license expires. To work around this, xapi will reapply the
current edition when it thinks that the license has expired, in order to
retrieve the latest license parameters.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
CA-103762: Reduce expiry recheck timeout to 10 minutes

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Merge pull request #1257 from mcclurmc/ca103762-master

CA-103762: Re-checkout license at expiry
Merge pull request #1238 from vbmithr/CA-101175

CA-101175: Increase timeout for Event.from to 30 seconds, only watch for...
CA-107242: license expiry: remove periodic scheduler callback

We are going to implement this differently.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-106080: Guard List.assoc "sku_type" license_params with mem_assoc

From code review on pull request #1226: since sku_type is a key that's returned
from v6d, and not present natively in xapi, we need to test that sku_type is
present before calling assoc on license_params.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
CA-107242: license expiry: add optional param "force" to host.apply_edition

...and use this in the xapi startup code, instead of the existing "startup" key,
in the apply_edition call to v6d.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #1226 from mcclurmc/ca106080-upgrade-enterprise-xd-master

CA-106080: DB upgrade rules update license_params.sku_type