Pearl1594 commented on a change in pull request #3894: Fixed count value in the 
list apis
URL: https://github.com/apache/cloudstack/pull/3894#discussion_r380727019
 
 

 ##########
 File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
 ##########
 @@ -1248,7 +1248,7 @@ private HypervisorType getHypervisorType(VMInstanceVO 
vm, StoragePool srcVolumeP
         final Map<Host, Boolean> requiresStorageMotion = new HashMap<Host, 
Boolean>();
         DataCenterDeployment plan = null;
         if (canMigrateWithStorage) {
-            allHostsPair = searchForServers(startIndex, pageSize, null, 
hostType, null, srcHost.getDataCenterId(), null, null, null, keyword, null, 
null, srcHost.getHypervisorType(),
+            allHostsPair = searchForServersExcluding(startIndex, pageSize, 
null, hostType, null, srcHost.getDataCenterId(), null, null, srcHostId, 
keyword, null, null, srcHost.getHypervisorType(),
                     srcHost.getHypervisorVersion());
             allHosts = allHostsPair.first();
             allHosts.remove(srcHost);
 
 Review comment:
   @weizhouapache True, however, it was noticed that, say if there were 15 
hosts, with a default pagesize of 10, the 1st page (considering it contained 
the src host) will have 9 objects returned and the 2nd page will have the 
remaining 5, as opposed to the ideal behavior of the 1st page containing 10 
items and the remaining 4 being listed on page 2.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to