Re: Correct a check for capacity arg of storageVolumeResize()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/02/2012 08:18 PM, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>
> 
> 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?
> ---
>  src/storage/storage_driver.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
> index 9130a40..66811ce 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,

ACK and pushed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]