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:
Peter Krempa 2019-06-05 15:37:30 +02:00
parent 0325d42668
commit 0491128f2a

View File

@ -15259,6 +15259,12 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
&diskdata, &ndiskdata) < 0)
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
* now either VIR_DOMAIN_SNAPSHOT_LOCATION_NONE, or
* VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL with a valid file name and