cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/6] git commit: updated refs/heads/4.6 to f66e782
Date Sun, 06 Dec 2015 19:02:51 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.6 998b1ba62 -> f66e78279


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/4.6
Commit: 52412286c657d384f86441095f5cbef510dd8763
Parents: 9a21873
Author: Wei Zhou <w.zhou@tech.leaseweb.com>
Authored: Fri Dec 4 08:18:09 2015 +0100
Committer: Wei Zhou <w.zhou@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();


Mime
View raw message