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>
Fix value in warning of space too small to unpack hotfix patch.
Previously the multiplier was not taken into account when reporting
details in the warning message.

Signed-off-by: Thomas Sanders <thomas.sanders@citrix.com>
Use mock pci.ids databse for testing

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Imported-by: John Else <john.else@citrix.com>

Conflicts:
	ocaml/test/test_pci_helpers.ml
Merge pull request #1694 from johnelse/mock-pcidb-tests-master

Use mock pci.ids for testing (from ocaml-pci-db)
CA-129239: Fix config file syncing

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Merge pull request #1695 from jonludlam/CA-129239

CA-129239: Fix config file syncing
Merge pull request #1678 from thomassa/ca124008-patch-upload-enospc

Report out-of-space, not patch-invalid
CA-130011:Prevent xapi from filling it's buffer and running out of memory while reading from an invalid device file

Signed-off-by: Akshay <akshay.ramani@citrix.com>
Merge pull request #1706 from johnelse/ca-130011

CA-130011:Prevent xapi from filling it's buffer and running out of memory while reading from an invalid device file
Whitespace: ocaml/gpg/gpg.ml

$ camlp4o -printer o -no_comments ocaml/gpg/gpg.ml | md5sum
83bf837cbe696c1c76f53893763c1617  -
$ git checkout HEAD^
$ camlp4o -printer o -no_comments ocaml/gpg/gpg.ml | md5sum
83bf837cbe696c1c76f53893763c1617  -

Signed-off-by: John Else <john.else@citrix.com>
Remove unexplained checksum from gpg.ml

This checksum was added many years ago, with no explanation and no
relation to the rest of the commit!

Signed-off-by: John Else <john.else@citrix.com>
Add comments

Signed-off-by: John Else <john.else@citrix.com>
CA-128701: Add new 64-bit gpg checksums

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

CA-128701: Add new 64-bit gpg checksums