shwstppr commented on code in PR #7949:
URL: https://github.com/apache/cloudstack/pull/7949#discussion_r1370084951


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -4690,11 +4645,28 @@ private Pair<List<SnapshotJoinVO>, Integer> 
searchForSnapshotsWithParams(final L
             sb.join("tagSearch", tagSearch, sb.entity().getId(), 
tagSearch.entity().getResourceId(), JoinBuilder.JoinType.INNER);
         }
 
+        if (storagePoolId != null) {
+            SearchBuilder<SnapshotDataStoreVO> storagePoolSb = 
snapshotDataStoreDao.createSearchBuilder();
+            storagePoolSb.and("poolId", 
storagePoolSb.entity().getDataStoreId(), SearchCriteria.Op.EQ);
+            storagePoolSb.and("role", storagePoolSb.entity().getRole(), 
SearchCriteria.Op.EQ);
+            sb.join("storagePoolSb", storagePoolSb, sb.entity().getId(), 
storagePoolSb.entity().getSnapshotId(), JoinBuilder.JoinType.INNER);
+        }

Review Comment:
   @vishesh92 can't we do something like the following?
           if (storagePoolId != null) {
               sc.setParameters("imageStoreId", storagePoolId); // change key 
for imageStoreId to storeId
               sc.setParameters("locationType", "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