mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
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)
|
if (info.inputPath)
|
||||||
virCommandAddArg(cmd, info.inputPath);
|
virCommandAddArg(cmd, info.inputPath);
|
||||||
virCommandAddArg(cmd, info.path);
|
virCommandAddArg(cmd, info.path);
|
||||||
if (!info.inputPath && info.size_arg)
|
if (!info.inputPath && (info.size_arg || !info.backingPath))
|
||||||
virCommandAddArgFormat(cmd, "%lluK", info.size_arg);
|
virCommandAddArgFormat(cmd, "%lluK", info.size_arg);
|
||||||
|
|
||||||
return cmd;
|
return cmd;
|
||||||
|
Loading…
Reference in New Issue
Block a user