From: Peter Krempa Date: Mon, 25 Nov 2013 13:51:25 +0000 (+0100) Subject: qemu: snapshot: Detect internal snapshots also for sheepdog and RBD X-Git-Tag: v1.1.3.2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=103f9bd3f2626612a5d3d58b1d1e0660a0fe2ee2;p=thirdparty%2Flibvirt.git qemu: snapshot: Detect internal snapshots also for sheepdog and RBD 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. (cherry picked from commit d8cf91ae38f8aa0da27fe72ba0b846021d8735c9) --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 491dfc7db0..2585a16bbc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11723,6 +11723,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 || @@ -11746,7 +11748,6 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def, disk->name); goto cleanup; } - found_internal = true; break; case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL: