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?
This commit is contained in:
Zeeshan Ali (Khattak) 2012-03-03 05:18:59 +02:00 committed by Eric Blake
parent d1c310231d
commit 4f3287a415

View File

@ -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;
}