cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [2/4] git commit: updated refs/heads/4.3 to 889d80b
Date Mon, 14 Apr 2014 11:34:09 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.
	modified:   plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java

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/cd20127f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cd20127f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cd20127f

Branch: refs/heads/4.3
Commit: cd20127fbb113d6a6d1bdad7035ac44da8b8893d
Parents: a782275
Author: Wido den Hollander <wido@widodh.nl>
Authored: Thu Apr 10 05:28:56 2014 +0200
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Mon Apr 14 13:27:08 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/cd20127f/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 bdccc10..76659ec 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
@@ -770,7 +770,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