Blob Blame History Raw
From be92659460866f1bd10f808de1fa3c739c09a59b Mon Sep 17 00:00:00 2001
Message-Id: <be92659460866f1bd10f808de1fa3c739c09a59b@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 26 Feb 2014 14:54:50 +0100
Subject: [PATCH] qemu: snapshot: Detect internal snapshots also for sheepdog
 and RBD

https://bugzilla.redhat.com/show_bug.cgi?id=1032370

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)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a7da257..796d3c1 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12167,6 +12167,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 ||
@@ -12190,7 +12192,6 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
                                disk->name);
                 goto cleanup;
             }
-            found_internal = true;
             break;
 
         case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL:
-- 
1.9.0