Arik Hadas has posted comments on this change. Change subject: engine: clear the pending memory when destroying paused VM ......................................................................
Patch Set 3: Code-Review-1 (3 comments) http://gerrit.ovirt.org/#/c/25271/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java: Line 299: private void decreasePendingVms() { Line 300: Guid vdsId = getCurrentVdsId(); Line 301: VM vm = getVm(); Line 302: if (vdsId == null || vdsId.equals(lastDecreasedVds)) { Line 303: log.debugFormat("PendingVms for {0} was already released, not releasing again", vm.getName()); how about also printing vdsId? it might be useful in the future Line 304: // do not decrease twice.. Line 305: return; Line 306: } Line 307: Line 361: * See VdsEventListener.processOnVmPoweringUp for more information. Line 362: */ Line 363: @Override Line 364: public void onPowerringUp() { Line 365: decreasePendingVms(); please read the javadoc above and don't change this method Line 366: } Line 367: Line 368: @Override Line 369: protected Map<String, Pair<String, String>> getExclusiveLocks() { http://gerrit.ovirt.org/#/c/25271/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java: Line 82: new DestroyVmVDSCommandParameters(new Guid(getVm().getMigratingToVds().toString()), Line 83: getVmId(), true, false, 0)); Line 84: } Line 85: Line 86: if (getVm().getStatus() == VMStatus.Paused && getVm().getVmPauseStatus() == VmPauseStatus.NOERR) { it is problematic to decrease the pending resources before doing the actual call for vdsm. the call to vdsm might fail and we won't increase the pending values that were just decreased. we should first call DestoryVm and only if it succeed, decrease the pending resources Line 87: VmStatic vmStatic = getVm().getStaticData(); Line 88: VmHandler.decreasePendingVms(getVm().getRunOnVds(), vmStatic.getNumOfCpus(), Line 89: vmStatic.getMinAllocatedMem(), vmStatic.getName()); Line 90: } -- To view, visit http://gerrit.ovirt.org/25271 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1de34ac8b0b6e48d360161d8f0ff8d1fe4f6fd04 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Jiří Moskovčák <jmosk...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Kobi Ianko <k...@redhat.com> Gerrit-Reviewer: Martin Sivák <msi...@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