render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c401cc
From be92659460866f1bd10f808de1fa3c739c09a59b Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <be92659460866f1bd10f808de1fa3c739c09a59b@dist-git>
c401cc
From: Peter Krempa <pkrempa@redhat.com>
c401cc
Date: Wed, 26 Feb 2014 14:54:50 +0100
c401cc
Subject: [PATCH] qemu: snapshot: Detect internal snapshots also for sheepdog
c401cc
 and RBD
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
c401cc
c401cc
When doing an internal snapshot on a VM with sheepdog or RBD disks we
c401cc
would not set a flag to mark the domain is using internal snapshots and
c401cc
might end up creating a mixed snapshot. Move the setting of the variable
c401cc
to avoid this problem.
c401cc
c401cc
(cherry picked from commit d8cf91ae38f8aa0da27fe72ba0b846021d8735c9)
c401cc
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/qemu/qemu_driver.c | 3 ++-
c401cc
 1 file changed, 2 insertions(+), 1 deletion(-)
c401cc
c401cc
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
c401cc
index a7da257..796d3c1 100644
c401cc
--- a/src/qemu/qemu_driver.c
c401cc
+++ b/src/qemu/qemu_driver.c
c401cc
@@ -12167,6 +12167,8 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
c401cc
 
c401cc
         switch (disk->snapshot) {
c401cc
         case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL:
c401cc
+            found_internal = true;
c401cc
+
c401cc
             if (def->state != VIR_DOMAIN_DISK_SNAPSHOT &&
c401cc
                 dom_disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
c401cc
                 (dom_disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG ||
c401cc
@@ -12190,7 +12192,6 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def,
c401cc
                                disk->name);
c401cc
                 goto cleanup;
c401cc
             }
c401cc
-            found_internal = true;
c401cc
             break;
c401cc
 
c401cc
         case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL:
c401cc
-- 
c401cc
1.9.0
c401cc