]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuSnapshotDiskPrepareActiveExternal: Handle only external snapshots
authorPeter Krempa <pkrempa@redhat.com>
Fri, 4 Mar 2022 13:34:02 +0000 (14:34 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 11 Mar 2022 12:55:49 +0000 (13:55 +0100)
Preparation steps ensure that the 'snapshot' field can only be
'VIR_DOMAIN_SNAPSHOT_LOCATION_NONE' or
VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL' at this point, but upcoming
patches will change that. Handle only external snapshots.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_snapshot.c

index cb2a7eb739647dbe0dba4b8472d601c60bd29191..f92b571b06dc97777318099ae4bf3145ff035242 100644 (file)
@@ -1165,7 +1165,7 @@ qemuSnapshotDiskPrepareActiveExternal(virDomainObj *vm,
     snapctxt = qemuSnapshotDiskContextNew(snapdef->ndisks, vm, asyncJob);
 
     for (i = 0; i < snapdef->ndisks; i++) {
-        if (snapdef->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)
+        if (snapdef->disks[i].snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
             continue;
 
         if (qemuSnapshotDiskPrepareOne(snapctxt,