cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [2/2] git commit: updated refs/heads/4.4 to 75792bf
Date Thu, 10 Apr 2014 14:08:40 GMT
CLOUDSTACK-4665: Check if a snapshot is protected before trying to unprotect

Otherwise a RBDException will be thrown with the message that the snapshot
isn't protected.

Conflicts:

	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/75792bf0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/75792bf0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/75792bf0

Branch: refs/heads/4.4
Commit: 75792bf08e86bfb9bb9c23c86d275f6fe5d4346b
Parents: 4e9810d
Author: Wido den Hollander <wido@widodh.nl>
Authored: Thu Apr 10 05:28:56 2014 +0200
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Thu Apr 10 15:59:12 2014 +0200

----------------------------------------------------------------------
 .../cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75792bf0/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index b6d527d..3161bcf 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -764,7 +764,13 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
                 RbdImage image = rbd.open(uuid);
                 List<RbdSnapInfo> snaps = image.snapList();
                 for (RbdSnapInfo snap : snaps) {
-                    image.snapUnprotect(snap.name);
+                    if (image.snapIsProtected(snap.name)) {
+                        s_logger.debug("Unprotecting snapshot " + pool.getSourceDir() + "/"
+ uuid + "@" + snap.name);
+                        image.snapUnprotect(snap.name);
+                    } else {
+                        s_logger.debug("Snapshot " + pool.getSourceDir() + "/" + uuid + "@"
+ snap.name + " is not protected.");
+                    }
+                    s_logger.debug("Removing snapshot " + pool.getSourceDir() + "/" + uuid
+ "@" + snap.name);
                     image.snapRemove(snap.name);
                 }
 


Mime
View raw message