Gilad Chaplik has uploaded a new change for review.

Change subject: core: vdsSelector: remove method used once (13/15)
......................................................................

core: vdsSelector: remove method used once (13/15)

I want to reduce method count, all methods names sounds the same to
me.
method removed: getAnyVdsToRunOn

Change-Id: I25d289c0fcfaa31ec5a4f9e5a0b35dea68693839
Signed-off-by: Gilad Chaplik <[email protected]>
---
M 
backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java
1 file changed, 6 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/15/13215/1

diff --git 
a/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java
 
b/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java
index a680a86..54b2bfc 100644
--- 
a/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java
+++ 
b/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java
@@ -59,16 +59,17 @@
 
     public Guid getVdsToRunOn(boolean isMigrate) {
         Guid result = Guid.Empty;
+        boolean vmNotPinned = false;
         if (getDestinationVdsId() != null) {
             VDS target_vds = 
DbFacade.getInstance().getVdsDao().get(getDestinationVdsId());
             log.infoFormat("Checking for a specific VDS only - id:{0}, 
name:{1}, host_name(ip):{2}",
                     getDestinationVdsId(), target_vds.getName(), 
target_vds.getHostName());
             result = getVdsToRunOn(new ArrayList<VDS>(Arrays.asList(new VDS[] 
{ target_vds })), isMigrate);
-            if (result.equals(Guid.Empty) && privateVm.getMigrationSupport() 
!= MigrationSupport.PINNED_TO_HOST) {
-                result = getAnyVdsToRunOn(isMigrate);
-            }
-        } else {
-            result = getAnyVdsToRunOn(isMigrate);
+        }
+        if (getDestinationVdsId() == null
+                || (result.equals(Guid.Empty) && 
privateVm.getMigrationSupport() != MigrationSupport.PINNED_TO_HOST)) {
+            result = getVdsToRunOn(DbFacade.getInstance().getVdsDao()
+                    .getAllOfTypes(new VDSType[] { VDSType.VDS, 
VDSType.oVirtNode }), isMigrate);
         }
 
         return result;
@@ -101,12 +102,6 @@
         }
 
         return returnValue;
-    }
-
-    private Guid getAnyVdsToRunOn(boolean isMigrate) {
-        return getVdsToRunOn(DbFacade.getInstance()
-                .getVdsDao()
-                .getAllOfTypes(new VDSType[] { VDSType.VDS, VDSType.oVirtNode 
}), isMigrate);
     }
 
     /**


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

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

Reply via email to