You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/12/07 08:14:32 UTC

[05/17] git commit: updated refs/heads/master to f30fbe9

CLOUDSTACK-8845: set isRevertable of snapshot to false if the volume is removed


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

Branch: refs/heads/master
Commit: 52412286c657d384f86441095f5cbef510dd8763
Parents: 9a21873
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Fri Dec 4 08:18:09 2015 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Fri Dec 4 08:21:11 2015 +0100

----------------------------------------------------------------------
 .../snapshot/StorageSystemSnapshotStrategy.java        | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/52412286/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
index 2c71525..d1470e4 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/StorageSystemSnapshotStrategy.java
@@ -442,6 +442,12 @@ public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase {
     public StrategyPriority canHandle(Snapshot snapshot, SnapshotOperation op) {
         long volumeId = snapshot.getVolumeId();
         VolumeVO volumeVO = _volumeDao.findById(volumeId);
+        if (SnapshotOperation.REVERT.equals(op)) {
+            if (volumeVO != null && ImageFormat.QCOW2.equals(volumeVO.getFormat()))
+                return StrategyPriority.DEFAULT;
+            else
+                return StrategyPriority.CANT_HANDLE;
+        }
 
         long storagePoolId;
 
@@ -459,13 +465,6 @@ public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase {
             storagePoolId = volumeVO.getPoolId();
         }
 
-        if (SnapshotOperation.REVERT.equals(op)) {
-            if (volumeVO != null && ImageFormat.QCOW2.equals(volumeVO.getFormat()))
-                return StrategyPriority.DEFAULT;
-            else
-                return StrategyPriority.CANT_HANDLE;
-        }
-
         DataStore dataStore = _dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary);
 
         Map<String, String> mapCapabilities = dataStore.getDriver().getCapabilities();