Re: [PATCH 1/2] storage: allow zero capacity with non-backing file to be created

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

 




On 06/30/2015 04:19 PM, Chris J Arges wrote:
> In commit fbcf7da95, a change was introduced that no longer allowed defining
> volumes via XML with a capacity of '0'. Because we check for info.size_arg to be
> non-zero, this use-case fails. This patch allows info.size_arg to be zero if no
> backing store is specified.
> 
> Signed-off-by: Chris J Arges <chris.j.arges@xxxxxxxxxxxxx>
> ---
>  src/storage/storage_backend.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Found an orphaned patch....

Since that's Jan's fix - he should have a say here, but it seems you're
correct. Also of note is commit id '155ca616e' which changed the check
to add that check for size_arg being non-zero.

The ordering of the date of when the change was created is odd. Commit
id 'fbcf7da95' was committed after '155ca616e', but authored months before.

I've copied Jan to get his thoughts.

John
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index ce59f63..c661662 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -1068,7 +1068,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virConnectPtr conn,
>      if (info.inputPath)
>          virCommandAddArg(cmd, info.inputPath);
>      virCommandAddArg(cmd, info.path);
> -    if (!info.inputPath && info.size_arg)
> +    if (!info.inputPath && (info.size_arg || !info.backingPath))
>          virCommandAddArgFormat(cmd, "%lluK", info.size_arg);
>  
>      return cmd;
> 

--
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]