mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
qemu: snapshot: Prevent too-nested domain XML when doing inactive snapshot
Similarly to 510d154a0b
we need to prevent
doing too deeply nested backing chains and reject them with a sane error
message.
Add a loop to go through the snapshots prior to attempting actually
creating them to prevent some possible inconsistent scenarios.
We don't need to do it when reusing backing chains as we'll be
re-detecting the backing chain in that case anyways.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
8e9e73a984
commit
b168fa88b8
@ -14653,6 +14653,9 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
|
||||
if (!snapdisk->src->format)
|
||||
snapdisk->src->format = VIR_STORAGE_FILE_QCOW2;
|
||||
|
||||
if (qemuDomainStorageSourceValidateDepth(defdisk->src, 1, defdisk->dst) < 0)
|
||||
return -1;
|
||||
|
||||
/* creates cmd line args: qemu-img create -f qcow2 -o */
|
||||
if (!(cmd = virCommandNewArgList(qemuImgPath,
|
||||
"create",
|
||||
|
Loading…
Reference in New Issue
Block a user