提交 c6eea540 编写于 作者: C Chris J Arges 提交者: John Ferlan

storage: allow zero capacity with non-backing file to be created

In commit 155ca616, 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: NChris J Arges <chris.j.arges@canonical.com>
上级 136f17ef
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册