Liron Aravot has posted comments on this change. Change subject: core: add disk profile to disk's commands ......................................................................
Patch Set 14: (5 comments) http://gerrit.ovirt.org/#/c/29038/14/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java: Line 594: return true; Line 595: } Line 596: Line 597: protected boolean setAndValidateDiskProfiles() { Line 598: if (diskInfoDestinationMap != null) { iirc it's initialized in the ctor, check that it's not empty . Line 599: Map<DiskImage, Guid> map = new HashMap<>(); Line 600: for (DiskImage diskImage : diskInfoDestinationMap.values()) { Line 601: map.put(diskImage, diskImage.getStorageIds().get(0)); Line 602: } http://gerrit.ovirt.org/#/c/29038/14/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java: Line 409: } Line 410: } Line 411: Line 412: protected boolean setAndValidateDiskProfiles() { Line 413: if (diskInfoDestinationMap != null) { iirc it's initialized in the ctor, check that it's not empty . Line 414: Map<DiskImage, Guid> map = new HashMap<>(); Line 415: for (DiskImage diskImage : diskInfoDestinationMap.values()) { Line 416: map.put(diskImage, diskImage.getStorageIds().get(0)); Line 417: } http://gerrit.ovirt.org/#/c/29038/14/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java: Line 399: return Integer.toString(getParameters().getVmsCount()); Line 400: } Line 401: Line 402: protected boolean setAndValidateDiskProfiles() { Line 403: if (diskInfoDestinationMap != null) { iirc it's initialized in the ctor, check that it's not empty . Line 404: Map<DiskImage, Guid> map = new HashMap<>(); Line 405: for (DiskImage diskImage : diskInfoDestinationMap.values()) { Line 406: map.put(diskImage, diskImage.getStorageIds().get(0)); Line 407: } http://gerrit.ovirt.org/#/c/29038/14/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CopyImageGroupCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CopyImageGroupCommand.java: Line 119: getParameters().getStorageDomainId(), Line 120: getParameters().getQuotaId(), Line 121: // using image since disk profile isn't mandatory in params (see Line 122: // setAndValidateDiskProfile). Line 123: getImage().getDiskProfileId())); the image is being copied to another domain, where does it's profile is set to a profile of the new domain? Line 124: } Line 125: Line 126: setSucceeded(true); Line 127: } http://gerrit.ovirt.org/#/c/29038/14/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java: Line 551: protected boolean setAndValidateDiskProfiles() { Line 552: if (getParameters().getVmTemplate().getDiskList() != null) { Line 553: Map<DiskImage, Guid> map = new HashMap<>(); Line 554: for (DiskImage diskImage : getParameters().getVmTemplate().getDiskList()) { Line 555: if (diskImage.getDiskStorageType() == DiskStorageType.IMAGE) { no need for the if..diskimage is diskimage :) Line 556: map.put(diskImage, imageToDestinationDomainMap.get(diskImage.getId())); Line 557: } Line 558: } Line 559: return validate(DiskProfileHelper.setAndValidateDiskProfiles(map)); -- To view, visit http://gerrit.ovirt.org/29038 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7b6d977243cffc0bde772665ebaca47340075c6 Gerrit-PatchSet: 14 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches