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.3-forward to aa9f29b
Date Thu, 10 Apr 2014 14:09:05 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/aa9f29bd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/aa9f29bd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/aa9f29bd

Branch: refs/heads/4.3-forward
Commit: aa9f29bd3f8d753fe2b6ccdba1f9a3718f54ca57
Parents: 6359520
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:58:19 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/aa9f29bd/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