Alona Kaplan has uploaded a new change for review.

Change subject: engine: VfScheduler shouldn't override the hostToVnicToVf
......................................................................

engine: VfScheduler shouldn't override the hostToVnicToVf

VfScheduler shouldn't override the hostToVnicToVf upon each
iteration of host validations, it causes removal of the previous hosts
data.

Change-Id: Ie8063b3c6e1049f693d4191050dcc3d0cbe0384a
Signed-off-by: Alona Kaplan <alkap...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfSchedulerImpl.java
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/60/41860/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfSchedulerImpl.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfSchedulerImpl.java
index 86541af..4ba29ca 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfSchedulerImpl.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/VfSchedulerImpl.java
@@ -47,8 +47,12 @@
     public List<String> validatePassthroughVnics(Guid vmId, Guid hostId,
             List<VmNetworkInterface> vnics) {
 
-        Map<Guid, Map<Guid, String>> hostToVnicToVfMap = new HashMap<>();
-        vmToHostToVnicToVfMap.put(vmId, hostToVnicToVfMap);
+        Map<Guid, Map<Guid, String>> hostToVnicToVfMap = 
vmToHostToVnicToVfMap.get(vmId);
+        if (hostToVnicToVfMap == null) {
+            hostToVnicToVfMap = new HashMap<>();
+            vmToHostToVnicToVfMap.put(vmId, hostToVnicToVfMap);
+        }
+
         Map<Guid, List<String>> nicToUsedVfs = new HashMap<>();
         Map<Guid, VdsNetworkInterface> fetchedNics = new HashMap<>();
         List<String> problematicVnics = new ArrayList<>();


-- 
To view, visit https://gerrit.ovirt.org/41860
To unsubscribe, visit https://gerrit.ovirt.org/settings

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

Reply via email to