This change allows systems like Pacemaker to manually manage VM shutdown upon dom0 shutdown.
It adds a new 'auto_poweroff' flag to block automatic VM shutdown within the shutdown.py script.

e.g. to set this on a VM:
xe vm-param-set other-config:auto_poweroff=false uuid=$UUID

This flag is complementary to the existing 'auto_poweron' flag.
CA-87552: add "Network.other_config:assume_network_is_shared=true" to override internal network checks

Normally we block VM.start, migrate etc if a VIF is on an "internal"
network which is already in use on another host. In the longer term we
should just tunnel, but in the short term we allow clients to specify
whether they want to allow the operations instead, per Network.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
networkd: set the broadcast address when configuring an IPv4 address

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Allow CLI lookup of PBDs by SR.name_label and host.name_label

The equivalent is already implemented for the other connector types
(VIFs, VBDs and PIFs).

Signed-off-by: John Else <john.else@citrix.com>
CA-88488: VM.reboot still exposed transient states where VBDs,VIFs were unplugged

A VBD or VIF is said to be 'active' while it is associated with a VM
even over a reboot. Unfortunately the record of which devices are 'active'
was stored in xenstore and deleted during the destroy phase of a reboot.

We now delay the deletion of the /vm/<uuid> tree until the VM metadata
is removed from xenopsd.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
CA-88267: if a critical xenstore key is missing, the udev vif script will signal failure

Rather than ignoring keys (such as vm/uuid) which should always be
present, the udev script will log the problem and signal the error
directly to the toolstack by writing

  hotplug-error = some error string

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Merge pull request #820 from djs55/CA-88488
CA-88388: Clean up VIF mapping keys after an interpool metadata transfer.

Signed-off-by: John Else <john.else@citrix.com>
Remove unnecessary checks before removing VDI mapping keys.

It's safe to call remove_from_other_config even if the key isn't
present.

Signed-off-by: John Else <john.else@citrix.com>
Add VDI and VIF metadata mapping keys as part of inter_pool_metadata_transfer.

This makes more sense as this function cleans them up after the transfer
and is the only point they're needed.

This also means that the VIF map is usable by assert_can_migrate.

Signed-off-by: John Else <john.else@citrix.com>
CA-88388: Clean up the cross-pool migration VIF mapping keys before importing a VIF.

Signed-off-by: John Else <john.else@citrix.com>
Add some comments to the VIF import code.

Signed-off-by: John Else <john.else@citrix.com>
Fix tab completion for VDI/VIF maps.

Signed-off-by: John Else <john.else@citrix.com>
Re-add xapi API methods related to cooperativeness.

This is done in order to prevent breaking compatibility. The implementations
are dummy, and are marked as such. The API methods are marked as deprecated.

Signed-off-by: Rok Strniša <rok.strnisa@citrix.com>
CA-88361: Clear the appliance field when importing a VM.

Signed-off-by: John Else <john.else@citrix.com>
CA-85776: Improve parsing of bootloader errors.

eliloader should now always throw a RuntimeError in line with pygrub,
so we now look for that in the stacktrace and raise the rest of the
stacktrace as an error message.

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #827 from johnelse/ca-88361
Merge pull request #826 from rokstrnisa/re-add-cooperativeness
Merge pull request #802 from johnelse/pbd-select-by-name-label
Merge pull request #800 from robhoes/broadcast