mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8845: set isRevertable of snapshot to false if the volume is removed
This commit is contained in:
parent
9a21873c4a
commit
52412286c6
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue