CA-125187: Add copy to VDI current_operations

Signed-off-by: John Else <john.else@citrix.com>
CA-125187: VBD allowed_operations fix

VBD allowed_operations checks should ignore running VDI.copy operations.
This wasn't needed before as VDIs weren't marked with the copy
operation.

Signed-off-by: John Else <john.else@citrix.com>
CA-125187: Don't automatically dismiss VDI operations during copy

We still want to allow VDI.snapshot while a VDI is being copied, as
well as multiple parallel copies.

Signed-off-by: John Else <john.else@citrix.com>
CA-126097: Block clone of live VDIs

Signed-off-by: John Else <john.else@citrix.com>
Fix test case name

Signed-off-by: John Else <john.else@citrix.com>
test VDIs should default to not sharable

Signed-off-by: John Else <john.else@citrix.com>
Improve readability of VDI allowed_operations test failures

Signed-off-by: John Else <john.else@citrix.com>
Add a case to a unit test

Signed-off-by: John Else <john.else@citrix.com>
Test that concurrent copies are allowed

Signed-off-by: John Else <john.else@citrix.com>
Add tests for clone/snapshot of VDIs during copying

Signed-off-by: John Else <john.else@citrix.com>
Add a test for VBD.allowed_operations

Test that a VBD.plug is not blocked by the VDI.copy which triggered it.

Signed-off-by: John Else <john.else@citrix.com>
CA-125187: Add explanation of the new behaviour

Signed-off-by: John Else <john.else@citrix.com>
CA-130161: Revert "CA-126097: Block clone of live VDIs"

Disks attached to a checkpoint look like they're live, so blocking clone
of live VDIs broke checkpoint revert.

This reverts commit a8aece189b38095c74a6e3b0aee3d8d255e42248.
CA-130161: Fix unit tests to test new behaviour

We've re-enabled clone of live VDIs, so the test needs to check this
instead of expecting failure.

Asserting whether a VDI can be cloned checks whether the backend
supports VDI_CLONE, so register the dummy SR with a dummy backend which
has a sensible set of features.

Signed-off-by: John Else <john.else@citrix.com>
CA-114498: Linux bonding: set properties (e.g. mode) before adding slaves

This is needed to get LACP bonding to work on the Linux bridge backend.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Merge pull request #1814 from robhoes/clearwater-sp1-lcm

CLEARWATER-SP1-LCM: CA-114498: Linux bonding: set properties (e.g. mode) before adding slave...
CA-141103: Do not set GRO on Linux VLAN devices

...at all. This involves removing the defaults from xcp-networkd.
The GRO settings for VLANs are inherited from the underlying physical
or bond interface.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Report out-of-space, not patch-invalid

If there isn't enough space on the filesystem to upload a patch (which can take
2-3 times the size of the patch, because of multiple copies and gpg signature
checking), we should fail with an Out_of_space exception. Before, if the gpg
check failed because there wasn't enough space to write the unsigned cleartext,
we would erroneously report patch_invalid. Now we check that there is enough
free space to signature check the patch (we make a guess of 2 * size of the
patch), and catch Unix.ENOSPC exceptions and handle them accordingly.

CA-124008

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
(cherry picked from commit 412b60bea61397a77a1c799077d2bcda97fd60b0)
Whitespace fix for get_patch_to_local

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
(cherry picked from commit da0ea340497401cca7b85948895b50a035c6cade)
assert_space_available takes optional multiplier arg

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
(cherry picked from commit 76fb912e0700e432f66c427152ac11a98d714222)