slavkap commented on a change in pull request #5544:
URL: https://github.com/apache/cloudstack/pull/5544#discussion_r786971759



##########
File path: 
server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java
##########
@@ -1332,33 +1327,12 @@ private void updateSnapshotPayload(long storagePoolId, 
CreateSnapshotPayload pay
         }
     }
 
-    private DataStoreRole getDataStoreRole(Snapshot snapshot, 
SnapshotDataStoreDao snapshotStoreDao, DataStoreManager dataStoreMgr) {
-        SnapshotDataStoreVO snapshotStore = 
snapshotStoreDao.findBySnapshot(snapshot.getId(), DataStoreRole.Primary);
-
-        if (snapshotStore == null) {
-            return DataStoreRole.Image;
-        }
-
-        long storagePoolId = snapshotStore.getDataStoreId();
-        DataStore dataStore = dataStoreMgr.getDataStore(storagePoolId, 
DataStoreRole.Primary);
-
-        Map<String, String> mapCapabilities = 
dataStore.getDriver().getCapabilities();
-
-        if (mapCapabilities != null) {
-            String value = 
mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString());
-            Boolean supportsStorageSystemSnapshots = new Boolean(value);
-

Review comment:
       @sureshanaparti, it should not break the functionality for the storage 
pools that have this capability. In your code snippet, the datastore will be 
`Primary` (without checking if it exists). In my change, I check for sure that 
the snapshot exists on the primary




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to