Omer Frenkel has posted comments on this change.
Change subject: core: simplify validation logic
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
Line 205: ||
!CanAddVm(getReturnValue().getCanDoActionMessages(), destStorages.values())
Line 206: || !hostToRunExist()) {
Line 207: return false;
Line 208: }
Line 209: return true;
why the above is in 2 separated if statements?
why not
return validateParameters(...) &&
checkNumberOfMonitors() &&
CheckPCIAndIDELimit(...) &&
......... ;
Line 210: }
Line 211:
Line 212: protected boolean checkNumberOfMonitors() {
Line 213: return
VmHandler.isNumOfMonitorsLegal(getParameters().getVmStaticData().getdefault_display_type(),
Line 538:
Line 539: if (vmStaticData != null) {
Line 540:
Line 541: if (vmStaticData.getMigrationSupport() ==
MigrationSupport.PINNED_TO_HOST
Line 542: || vmStaticData.getauto_startup()) {
this is a bug, user will not be able to add HA vm.. (if
vmStaticData.getauto_startup() == true it will return false,
code should be
if (vmStaticData.getMigrationSupport() == MigrationSupport.PINNED_TO_HOST &&
vmStaticData.getauto_startup())
please also add test for this case
Line 543:
reasons.add(VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_BE_HIGHLY_AVAILABLE_AND_PINNED_TO_HOST
Line 544: .toString());
Line 545: return false;
Line 546: }
--
To view, visit http://gerrit.ovirt.org/5708
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3a5ba45b8d67977aa29148a0c18e26fcb72b01e5
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches