From: Zeeshan Ali (Khattak) Date: Sat, 3 Mar 2012 03:18:59 +0000 (+0200) Subject: Correct a check for capacity arg of storageVolumeResize() X-Git-Tag: v0.9.11-rc1~166 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f3287a415881988b09f153cb72bea5182964af9;p=thirdparty%2Flibvirt.git Correct a check for capacity arg of storageVolumeResize() Lets say I got a volume with '1G' allocation and '10G' capacity. The available space in the parent pool is '5G'. With the current check for overcapacity, I can only try to resize to <= '6G'. You see the problem? --- diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 9130a40f5c..66811ce24c 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1758,8 +1758,8 @@ storageVolumeResize(virStorageVolPtr obj, goto out; } - if (abs_capacity > vol->allocation + pool->def->available) { - virStorageReportError(VIR_ERR_INVALID_ARG, + if (abs_capacity > vol->capacity + pool->def->available) { + virStorageReportError(VIR_ERR_OPERATION_FAILED, _("Not enough space left on storage pool")); goto out; }