Hello Gilad Chaplik,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/15817

to review the following change.

Change subject: core: remove vdsSelector CheckDestinationFirst
......................................................................

core: remove vdsSelector CheckDestinationFirst

it's always true ...

Gerrit-cntr: 1
Change-Id: I5f9ce4357a85727f1a2016a46c0ce8f00621fd4c
Signed-off-by: Gilad Chaplik <[email protected]>
---
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/RunVmCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
4 files changed, 5 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/17/15817/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 56a3242..f62c5a7 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
@@ -39,7 +39,7 @@
 
     public MigrateVmCommand(T parameters) {
         super(parameters);
-        setVdsSelector(new VdsSelector(getVm(), getVdsDestinationId(), true, 
new VdsFreeMemoryChecker(this)));
+        setVdsSelector(new VdsSelector(getVm(), getVdsDestinationId(), new 
VdsFreeMemoryChecker(this)));
         forcedMigrationForNonMigratableVM = 
parameters.isForceMigrationForNonMigratableVM();
     }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
index 601621b..1075a03 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
@@ -135,7 +135,7 @@
 
         if (getVm() != null) {
             Guid destVdsId = (getDestinationVds() != null) ? (Guid) 
getDestinationVds().getId() : null;
-            setVdsSelector(new VdsSelector(getVm(), destVdsId, true, new 
VdsFreeMemoryChecker(this)));
+            setVdsSelector(new VdsSelector(getVm(), destVdsId, new 
VdsFreeMemoryChecker(this)));
 
             refreshBootParameters(runVmParameters);
             getVm().setLastStartTime(new Date());
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
index b3cd76f..46f4e42 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java
@@ -231,7 +231,6 @@
                 new VdsSelector(vm,
                         runVmParams.getDestinationVdsId() != null ?
                                 runVmParams.getDestinationVdsId() : 
vm.getDedicatedVmForVds(),
-                        true,
                         new VdsFreeMemoryChecker(new NonWaitingDelayer()));
 
         return getRunVmValidator().canRunVm(vm,
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
index ccaae49..600cc90 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
@@ -41,16 +41,6 @@
         return privateRunVdssList;
     }
 
-    private boolean privateCheckDestinationFirst;
-
-    public boolean getCheckDestinationFirst() {
-        return privateCheckDestinationFirst;
-    }
-
-    public void setCheckDestinationFirst(boolean value) {
-        privateCheckDestinationFirst = value;
-    }
-
     private NGuid privateDestinationVdsId;
 
     public NGuid getDestinationVdsId() {
@@ -72,26 +62,18 @@
         privateVm = value;
     }
 
-    public VdsSelector(VM vm, NGuid destinationVdsId, boolean dedicatedFirst, 
VdsFreeMemoryChecker memoryChecker) {
+    public VdsSelector(VM vm, NGuid destinationVdsId, VdsFreeMemoryChecker 
memoryChecker) {
         setVm(vm);
         setDestinationVdsId(destinationVdsId);
-        setCheckDestinationFirst(dedicatedFirst);
         this.memoryChecker = memoryChecker;
     }
 
     public Guid getVdsToRunOn(boolean isMigrate) {
         Guid result = Guid.Empty;
         if (getDestinationVdsId() != null) {
-            if (getCheckDestinationFirst()) {
-                result = getVdsRunOnDestination(isMigrate);
-                if (result.equals(Guid.Empty) && 
privateVm.getMigrationSupport() != MigrationSupport.PINNED_TO_HOST) {
-                    result = getAnyVdsToRunOn(isMigrate);
-                }
-            } else {
+            result = getVdsRunOnDestination(isMigrate);
+            if (result.equals(Guid.Empty) && privateVm.getMigrationSupport() 
!= MigrationSupport.PINNED_TO_HOST) {
                 result = getAnyVdsToRunOn(isMigrate);
-                if (result.equals(Guid.Empty)) {
-                    result = getVdsRunOnDestination(isMigrate);
-                }
             }
         } else {
             result = getAnyVdsToRunOn(isMigrate);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f9ce4357a85727f1a2016a46c0ce8f00621fd4c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to