mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 9941: fixed listVolumes api - use leftouter join with vm_instance table because instance_id is NULL for detached volumes
status 9941: resolved fixed Conflicts: server/src/com/cloud/api/ApiResponseHelper.java server/src/com/cloud/server/ManagementServerImpl.java
This commit is contained in:
parent
7bae4e3155
commit
24e86c109e
@ -798,9 +798,11 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
volResponse.setVirtualMachineId(vm.getId());
|
||||
volResponse.setVirtualMachineName(vm.getHostName());
|
||||
UserVm userVm = ApiDBUtils.findUserVmById(vm.getId());
|
||||
if (userVm != null) {
|
||||
volResponse.setVirtualMachineDisplayName(userVm.getDisplayName());
|
||||
volResponse.setVirtualMachineState(vm.getState().toString());
|
||||
}
|
||||
}
|
||||
|
||||
// Show the virtual size of the volume
|
||||
volResponse.setSize(volume.getSize());
|
||||
|
||||
@ -2342,7 +2342,8 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
// display user vm volumes only
|
||||
SearchBuilder<VMInstanceVO> vmSearch = _vmInstanceDao.createSearchBuilder();
|
||||
vmSearch.and("type", vmSearch.entity().getType(), SearchCriteria.Op.NIN);
|
||||
sb.join("vmSearch", vmSearch, sb.entity().getInstanceId(), vmSearch.entity().getId(), JoinBuilder.JoinType.INNER);
|
||||
vmSearch.or("nulltype", vmSearch.entity().getType(), SearchCriteria.Op.NULL);
|
||||
sb.join("vmSearch", vmSearch, sb.entity().getInstanceId(), vmSearch.entity().getId(), JoinBuilder.JoinType.LEFTOUTER);
|
||||
|
||||
// now set the SC criteria...
|
||||
SearchCriteria<VolumeVO> sc = sb.create();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user