CA-82500: Determine and set the gateway/DNS interface for every bring_pif_up

Only then we are sure that it is always set correctly.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-79548: Fix xe host-dmesg

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Fix newline printing in error cases in the cli

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-80781: When moving a VIF, only attach the associated network in Xapi_xenops

The original code attached the networks for all VIFs of the VM. However, vif_move is
typically called sequentially for several VIFs of a VM, e.g. when moving VIFs from a bond
slave to the bond master during a Bond.create. We should be careful not to try to attach
networks for bond slaves, and therefore attach only the network needed by the VIF that is
moved.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Call Nm.bring_pif_up directly from Xapi_pif.plug

Xapi_pif.plug now calls Nm.bring_pif_up directly rather than going through
Xapi_network.attach_internal. This is a little more efficient.

Besides calling Nm.bring_pif_up, Xapi_network.attach_internal does the following:
* Creating a bridge for an internal/private network, if needed.
* Starting the HIMN, if needed.
* Checking whether we aren't plugging a bond slave, which is illegal.

Only the last item is needed for PIF.plug, so we are now doing this check in
Xapi_pif itself.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-80933: Do not re-plug PIFs that are already attached in Xapi_network.attach_internal

This code path is used e.g. when VIFs are plugged, especially on VM.start. The
patch ensures that no time is wasted in these cases. PIF.plug, PIF.reconfigure_ip and
Host.management_reconfigure calls do always trigger networkd to update its state
and any to perform other low-level networking setup that needs to be sync'ed.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-80781: Do bond-slave check only if PIF is not yet attached

Otherwise we can get in trouble when moving VIFs during a Bond
create or destroy.

Also eliminate an "assert" function that returned a value.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-75139: Allow locked VIFs to receive broadcast traffic under bridge.

This removes filtering of traffic being received by VMs, making IPv4
locking under bridge functionally identical to locking under vSwitch.

Signed-off-by: John Else <john.else@citrix.com>
CA-75638: Fix handling of IPv6 by locking VIFs under bridge.

When using bridge, if a VIF is locked and has any IPv6 addresses
associated with it, all IPv6 traffic will be allowed.

When the VIF has no IPv6 addresses associated with it, no IPv6 traffic
will be allowed, as before.

Signed-off-by: John Else <john.else@citrix.com>
Homogenise indentation
CA-82791: Fix performance; add spaces after regular words

Do not add spaces after keys such as 'foo=' or 'foo:'
Merge commit '8196107e170ae541051aa2400c880b855f6aa000'
Merge commit 'ca5e256ab288b065a90e8ab6d25489f4a1f6f695'
Merge commit '291cbe5817af4f75e498cf38e5265f401af65905'
Merge commit 'eac1a97179a7d1fb4cd4e572cbbcd8d37b8e1d94'
CA-78221: add "base_mirror=true" in VDIs other-config field when the VDI is part of mirroring operations.

XenCenter can then look for this field in order to hide the VDIs during storing motion.
CA-78221: add a new SM call VDI.remove_from_other_config

We use this call when the storage motion is successful to remove the "base_mirror" key from other-config (this will make the mirgated VDIs to appear in XenCenter)
CA-78221: use the right vdi_info record to call VDI.snapshot before sending the disk contents to the receiver.

This will add "base_mirror=sr_uuid/vdi_uuid" to VDI.other_config
CA-78221: use sm-config instead of other-config

Also remove the ~params field of create/clone/snapshot calls are now we can pass the parameters using sm-config
[CA-78221] Simplify the storage API for VDI.create,clone,snapshot.

'vdi' was both an argument and a field in the vdi_info record. Now it is only in the record.