CLOUDSTACK-7481: Assertion/exception in listVolumes call from UI with assert enabled

searchForVolumesInternal() indicated some inconsistency in the use of entity().isDisplayVolume() property – used twice as “display” and “displayVolume” in search criteria. And then exception/assert happens while setting the property.
Correcting the issue.
This commit is contained in:
Nitin Mehta 2014-09-05 11:35:11 -07:00
parent 41fdc418ff
commit f9d7a12a57

View File

@ -1738,9 +1738,6 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
// display UserVM volumes only
sb.and().op("type", sb.entity().getVmType(), SearchCriteria.Op.NIN);
sb.or("nulltype", sb.entity().getVmType(), SearchCriteria.Op.NULL);
if (!(cmd instanceof ListVolumesCmdByAdmin)) {
sb.and("displayVolume", sb.entity().isDisplayVolume(), SearchCriteria.Op.EQ);
}
sb.cp();
// now set the SC criteria...
@ -1761,7 +1758,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
}
if (display != null) {
sc.setParameters("displayVolume", display);
sc.setParameters("display", display);
}
sc.setParameters("systemUse", 1);
@ -1802,10 +1799,6 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
sc.setParameters("storageId", storageId);
}
if (!(cmd instanceof ListVolumesCmdByAdmin)) {
sc.setParameters("displayVolume", 1);
}
// Don't return DomR and ConsoleProxy volumes
sc.setParameters("type", VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.SecondaryStorageVm, VirtualMachine.Type.DomainRouter);