You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2015/01/26 22:57:35 UTC
git commit: updated refs/heads/master to c847831
Repository: cloudstack
Updated Branches:
refs/heads/master abf4e5c64 -> c84783166
Do not allow deletion of the snapshot if the snapshot is being copied
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c8478316
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c8478316
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c8478316
Branch: refs/heads/master
Commit: c8478316624e334749a91a975d08ed035a9293ed
Parents: abf4e5c
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Jan 26 09:15:56 2015 -0700
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Mon Jan 26 14:57:28 2015 -0700
----------------------------------------------------------------------
.../storage/snapshot/StorageSystemSnapshotStrategy.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8478316/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 c4946ab..90c7244 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
@@ -28,6 +28,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
+import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory;
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotResult;
@@ -117,6 +118,10 @@ public class StorageSystemSnapshotStrategy extends SnapshotStrategyBase {
return true;
}
+ if (ObjectInDataStoreStateMachine.State.Copying.equals(snapshotObj.getStatus())) {
+ throw new InvalidParameterValueException("Unable to delete snapshotshot " + snapshotId + " because it is in the copying state.");
+ }
+
try {
snapshotObj.processEvent(Snapshot.Event.DestroyRequested);
}