Arik Hadas has uploaded a new change for review. Change subject: core: fix regression related to update pool ......................................................................
core: fix regression related to update pool Because of the use of do-while to add the missing VMs in pool after updating the pool, we were adding a VM also in case no new VMs where requested (because of the 'do' part). The solution is to replace the do-while with for loop. Change-Id: I027d687ecca87dd5eb784e99cd14b115ad55903f Signed-off-by: Arik Hadas <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/28307/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java index 1ce889d..d569fa3 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java @@ -126,8 +126,7 @@ int subsequentFailedAttempts = 0; int vmPoolMaxSubsequentFailures = Config.<Integer> getValue(ConfigValues.VmPoolMaxSubsequentFailures); - int numOfVms = 0; - do { + for (int i=0; i<getParameters().getVmsCount(); i++) { String currentVmName = generateUniqueVmName(); VdcReturnValueBase returnValue = Backend.getInstance().runInternalAction(VdcActionType.AddVmAndAttachToPool, @@ -153,7 +152,7 @@ break; } isAtLeastOneVMCreationFailed = isAtLeastOneVMCreationFailed || !addVmsSucceded; - } while (++numOfVms < getParameters().getVmsCount()); + } getReturnValue().setCanDoAction(!isAtLeastOneVMCreationFailed); setSucceeded(!isAtLeastOneVMCreationFailed); -- To view, visit http://gerrit.ovirt.org/28307 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I027d687ecca87dd5eb784e99cd14b115ad55903f Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
