xapi-project/xen-api — pull request #1820 by kaifengz (2014-07-08 08:39:13+00:00)
Title: CA-124008: Report out-of-space, not patch-invalid

Requested by HFX-1226. Merge Thomas's fix from master branch
(https://github.com/xapi-project/xen-api/pull/1678)

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.