Add a new host parameter: guest_VCPUs_params.

It has a similar function to that defined on guests, but it is per
host. It is also limited only to be used for defining masks, and
not on a per-vcpu basis (i.e., it defines which pcpus are available
for use by a VM at all). The VM and host masks are effectively
anded together to get the final mask.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-94406: VDI reset only on epoch begin

This resolves a bug where VDIs were reset after migration, because the act of
plugging a VBD will reset the VDI. A corresponding change in the storage
managers moves the reset_leaf call (which resets VDIs) to the SR command
"vdi_epoch_begin", which was recently added to Xapi's SMAPIv2.

This commit just adds the plumbing necessary to call epoch_begin and epoch_end
on VDIs in the storage layer. The corresponding commit in sm.hg adds those
commands to the storage layer, and also moves the reset_leaf call into
vdi_epoch_begin.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
CA-93613: Balance memory raises an exception if squeezed is stopped

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Merge pull request #929 from jeromemaloberti/CA-93613

CA-93613: Balance_memory raises an exception if squeezed is stopped
CA-95060: Keep trying xenopsd->SMAPI calls until they stop throwing ECONNREFUSED.

If xapi is not running, xenopsd should wait indefinitely for it to
return when trying to make SMAPI calls.

Signed-off-by: John Else <john.else@citrix.com>
CA-95060: Move exception No_storage_plugin_for_sr to storage_interface.ml

This makes it easier to catch for SMAPI clients, since it no longer gets
wrapped in a Storage_interface.Internal_error.

Signed-off-by: John Else <john.else@citrix.com>
Whitespace: Xenops_server_xen.Storage.dp_destroy

Signed-off-by: John Else <john.else@citrix.com>
CA-95060: Ignore Storage_interface.No_storage_plugin_for_sr when calling DP.destroy from xenops.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #934 from johnelse/ca-95060

CA-95060 - If a VM shuts down on a slave when xapi is not running, its disks are not deactivated when xapi starts up again
Remove erroneous extra call to VDI.epoch_end

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
CA-52725 : Friendly error message when attempting to delete a VLAN of an unreachable host.
CA-94159: Maintain only one console of each type
Issue- Restarting XAPI creates a new RFB Console object for Dom0
Solution - In the case of multiple console objects, remove duplicates and maintain only one console of each type
CA-91416: Remove set-dom0-memory-target-from-packs.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Merge pull request #945 from siddharthv/CA-94159

CA-94159: Maintain only one console of each type
Merge pull request #946 from jeromemaloberti/CA-91416

CA-91416: Remove set-dom0-memory-target-from-packs.
CA-95645: fix Python 2.6 type error comparing DateTime

We compare the result of an rpc call with a constant called
_RECONNECT_AND_RETRY (which was just set to an anonymous function) to decide if
we need to retry the rpc call. When the result is a DateTime object, and we're
using python 2.6+, this comparison (using ==) throws an exception.

The fix is to use the 'is' operator instead of '==', so that we're testing
object equality, and not structural equality. We also set the
_RECONNECT_AND_RETRY constant to object(), which is more sensible than (lambda
_ : ()).

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
Merge pull request #941 from akshayramani/CA-52725

CA-52725 : Raise a host_offline exception when attempting to destroy a VLAN on an unreachable host.
Merge pull request #925 from jonludlam/host-cpu-pinning

Add a new host parameter: guest_VCPUs_params.
Import patch api-remove-TypeToXml
Import api-autogen-use-rpc-light