Allon Mureinik has posted comments on this change.
Change subject: core: removed limitation of get topSizeVms query
......................................................................
Patch Set 4: Looks good to me, but someone else must approve
(6 inline comments)
Please do not merge without Michael Pasternak's review
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/GetVmsByStorageDomainQuery.java
Line 16: import org.ovirt.engine.core.common.queries.VdcQueryType;
Line 17: import org.ovirt.engine.core.compat.Guid;
Line 18:
Line 19: public class GetVmsByStorageDomainQuery<P extends
StorageDomainQueryParametersBase>
Line 20: extends QueriesCommandBase<P> {
Isn't this query relevant for the user portal too?
Line 21: public GetVmsByStorageDomainQuery(P parameters) {
Line 22: super(parameters);
Line 23: }
Line 24:
Line 32: // get all disks and snapshots
Line 33: VdcQueryReturnValue queryReturnValue =
getAllDisksByStorageDomain(domainId);
Line 34: if (queryReturnValue.getSucceeded()) {
Line 35: disksOfDomain = (List<DiskImage>)
queryReturnValue.getReturnValue();
Line 36: }
what about error handling if the query failed?
Line 37:
Line 38: Map<String, VM> vmNameToVMMap = new HashMap();
Line 39:
Line 40: for (VM vm : vms) {
Line 42: }
Line 43:
Line 44: for (DiskImage disk : disksOfDomain) {
Line 45: List<String> vmNames = disk.getVmNames();
Line 46: if (vmNames == null) {
Is this even possible?
Line 47: continue;
Line 48: }
Line 49: for (String vmName : vmNames) {
Line 50: VM vm = vmNameToVMMap.get(vmName);
Line 49: for (String vmName : vmNames) {
Line 50: VM vm = vmNameToVMMap.get(vmName);
Line 51: if (vm != null) {
Line 52: vm.getDiskMap().put(disk.getId(), disk);
Line 53: vm.getDiskList().add(disk);
not sure if related to this patch, but we really need a method like
vm.addDisk(DiskImage)
Line 54: }
Line 55: }
Line 56:
Line 57: }
Line 61: getQueryReturnValue().setReturnValue(vms);
Line 62: }
Line 63:
Line 64: protected VdcQueryReturnValue getAllDisksByStorageDomain(Guid
domainId) {
Line 65: return
Backend.getInstance().RunQuery(VdcQueryType.GetAllDisksByStorageDomainId,
use getBackend() instead of Backend.getInstance()
Line 66: new StorageDomainQueryParametersBase(domainId));
Line 67: }
Line 68:
Line 69: protected List<VM> getAllVMsForStorageDomain(Guid domainId) {
....................................................
Commit Message
Line 5: CommitDate: 2013-05-08 13:48:17 +0300
Line 6:
Line 7: core: removed limitation of get topSizeVms query
Line 8:
Line 9: Use a new query to display vms(with disks and snapshots) in Storage main
add space before the "("
Line 10: tab-VMs sub tab. Removed the previously used query
Line 11: GetTopSizeVmsFromStorageDomain.
Line 12: Also, clean unused usages of the old query in REST and UI and added
test
Line 13: for the new query.
--
To view, visit http://gerrit.ovirt.org/14558
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia44f746a9321282fa99c7a11de92e720e3e0c610
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches