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>
Whitespace fix for get_patch_to_local

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
assert_space_available takes optional multiplier arg

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
get_patch_to_local checks filesystem space on slave

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
mkdir -p /var/patch, which might not be there

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
whitespace: spaces to tabs

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
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>
Make /etc/xcp if necessary

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Make xapi more resiliant to missing config files

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Avoid calling the mail-alarm script if it doesn't exist.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>