winterhazel commented on code in PR #13897:
URL: https://github.com/apache/cloudstack/pull/13897#discussion_r4320787697


##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1278,40 +1286,29 @@ public PrimaryDataStoreInfo 
updateStoragePool(UpdateStoragePoolCmd cmd) throws I
         if (capacityIops != null) {
             if (!capacityIops.equals(pool.getCapacityIops())) {
                 updatedCapacityIops = capacityIops;
+                 details.put(PrimaryDataStoreLifeCycle.CAPACITY_IOPS, 
String.valueOf(updatedCapacityIops));
                 changes = true;
             }
         }
 
-        // retrieve current details and merge/overlay input to capture changes
-        Map<String, String> details = null;
-        details = _storagePoolDetailsDao.listDetailsKeyPairs(id);
-        if (inputDetails != null) {
-            details.putAll(inputDetails);
-            changes = true;
-        }
-
         if (changes) {
-            StoragePoolVO storagePool = _storagePoolDao.findById(id);
-            DataStoreProvider dataStoreProvider = 
_dataStoreProviderMgr.getDataStoreProvider(storagePool.getStorageProviderName());
+            DataStoreProvider dataStoreProvider = 
_dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
             DataStoreLifeCycle dataStoreLifeCycle = 
dataStoreProvider.getDataStoreLifeCycle();
-
             if (dataStoreLifeCycle instanceof PrimaryDataStoreLifeCycle) {
+                if (cmd.getUrl() != null) {
+                   details.put("url", cmd.getUrl());
+                }
+                
((PrimaryDataStoreLifeCycle)dataStoreLifeCycle).updateStoragePool(pool, 
details);

Review Comment:
   Also, isn't it better to call this method after `pool.setCapacityBytes` and 
`pool.setCapacityIops` (immediately before `_storagePoolDao.update`)?



-- 
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