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

 



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(-)

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;
-- 
1.9.1

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