]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: snapshot: Detect internal snapshots also for sheepdog and RBD
authorPeter Krempa <pkrempa@redhat.com>
Mon, 25 Nov 2013 13:51:25 +0000 (14:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 2 Dec 2013 13:31:03 +0000 (14:31 +0100)
When doing an internal snapshot on a VM with sheepdog or RBD disks we
would not set a flag to mark the domain is using internal snapshots and
might end up creating a mixed snapshot. Move the setting of the variable
to avoid this problem.

src/qemu/qemu_driver.c

index 47d8a09d027df4c1403b09a219176330bb02d8de..325d85faa60f4d09f474dac9d2fb753573b301f6 100644 (file)
@@ -11766,6 +11766,8 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
 
         switch (disk->snapshot) {
         case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL:
+            found_internal = true;
+
             if (def->state != VIR_DOMAIN_DISK_SNAPSHOT &&
                 dom_disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
                 (dom_disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG ||
@@ -11789,7 +11791,6 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
                                disk->name);
                 goto cleanup;
             }
-            found_internal = true;
             break;
 
         case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL: