Arik Hadas has uploaded a new change for review.

Change subject: core: decrease pending memory & cpu from the right vds on run vm
......................................................................

core: decrease pending memory & cpu from the right vds on run vm

On rerun attempt in RunVm/RunVmOnce flow we could decrease the pending
resources from the wrong VDS, i.e not from the VDS the VM was supposed
to run on, in case dedicated VDS was defined for the VM or a specific
VDS was set in RunVmOnce flow.

This patch changes the selection of the VDS for which we should decrease
the pending resources to use RunVmCommandBase#getCurrentVdsId method
which should always return the VDS on which the VM was about to run on.

Change-Id: I7b82e4ef4f9e5ed60542e756640861f7403be090
Bug-Url: https://bugzilla.redhat.com/1061811
Signed-off-by: Arik Hadas <aha...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/24254/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
index 1dfdc68..dc59923 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
@@ -420,7 +420,8 @@
 
     @Override
     protected Guid getCurrentVdsId() {
-        return getDestinationVdsId() != null ? getDestinationVdsId() : 
super.getCurrentVdsId();
+        Guid destinationVdsId = getDestinationVdsId();
+        return destinationVdsId != null ? destinationVdsId : 
super.getCurrentVdsId();
     }
 
     public String getDuration() {
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
index 619131a..9dff5bd 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
@@ -82,8 +82,7 @@
 
     @Override
     public void rerun() {
-        Guid vdsId = getDestinationVds() != null ? getDestinationVds().getId() 
: getCurrentVdsId();
-        decreasePendingVms(vdsId);
+        decreasePendingVms(getCurrentVdsId());
 
         setSucceeded(false);
         setVm(null);


-- 
To view, visit http://gerrit.ovirt.org/24254
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b82e4ef4f9e5ed60542e756640861f7403be090
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to