From c6eea5400822ca191949aabda19fcf69d29b40e2 Mon Sep 17 00:00:00 2001 From: Chris J Arges Date: Tue, 30 Jun 2015 15:19:03 -0500 Subject: [PATCH] storage: allow zero capacity with non-backing file to be created In commit 155ca616e, 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 --- 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 2b7cf5a719..db4973960a 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -1075,7 +1075,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; -- GitLab