mirror of https://gitee.com/openkylin/libvirt.git
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 <chris.j.arges@canonical.com>
This commit is contained in:
parent
136f17efd1
commit
c6eea54008
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue