Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C851A1851C for ; Sun, 6 Dec 2015 19:02:59 +0000 (UTC) Received: (qmail 94325 invoked by uid 500); 6 Dec 2015 19:02:51 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 94277 invoked by uid 500); 6 Dec 2015 19:02:51 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 94254 invoked by uid 99); 6 Dec 2015 19:02:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Dec 2015 19:02:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7AFE5E01FB; Sun, 6 Dec 2015 19:02:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dahn@apache.org To: commits@cloudstack.apache.org Date: Sun, 06 Dec 2015 19:02:51 -0000 Message-Id: <808c9fc426304ac8af0bfb8aafd93a0d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/6] git commit: updated refs/heads/4.6 to f66e782 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 Authored: Fri Dec 4 08:18:09 2015 +0100 Committer: Wei Zhou 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 mapCapabilities = dataStore.getDriver().getCapabilities();