mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
qemu: snapshot: Return early if there's nothing to snapshot
Skip actual snapshot creation code if we have 0 disks to snapshot. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
0325d42668
commit
0491128f2a
@ -15259,6 +15259,12 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
|||||||
&diskdata, &ndiskdata) < 0)
|
&diskdata, &ndiskdata) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
/* check whether there's anything to do */
|
||||||
|
if (ndiskdata == 0) {
|
||||||
|
ret = 0;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
/* Based on earlier qemuDomainSnapshotPrepare, all disks in this list are
|
/* Based on earlier qemuDomainSnapshotPrepare, all disks in this list are
|
||||||
* now either VIR_DOMAIN_SNAPSHOT_LOCATION_NONE, or
|
* now either VIR_DOMAIN_SNAPSHOT_LOCATION_NONE, or
|
||||||
* VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL with a valid file name and
|
* VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL with a valid file name and
|
||||||
|
Loading…
Reference in New Issue
Block a user