Moti Asayag has uploaded a new change for review.

Change subject: engine: NetworkQoS should be sent to vdsm on nic hotplug
......................................................................

engine: NetworkQoS should be sent to vdsm on nic hotplug

The patch assures the network QoS parameters are being
sent to vdsm as entries of the specParams map.

Change-Id: Ic6fc4a7cd517bfea733cd2e89877ab9d8c34c78e
Bug-Url: https://bugzilla.redhat.com/1002281
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
2 files changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/18675/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java
index b2b650d..c31807a 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java
@@ -37,9 +37,6 @@
         VmNic nic = getParameters().getNic();
         VmDevice vmDevice = getParameters().getVmDevice();
         Version clusterVersion = 
getParameters().getVm().getVdsGroupCompatibilityVersion();
-
-        VmInfoBuilder.addProfileDataToNic(map, getParameters().getVm(), 
vmDevice, nic);
-
         map.put(VdsProperties.Type, vmDevice.getType().getValue());
         map.put(VdsProperties.Device, VmDeviceType.BRIDGE.getName());
         map.put(VdsProperties.MAC_ADDR, nic.getMacAddress());
@@ -47,6 +44,7 @@
         if (FeatureSupported.networkLinking(clusterVersion)) {
             map.put(VdsProperties.LINK_ACTIVE, String.valueOf(nic.isLinked()));
         }
+
         addAddress(map, vmDevice.getAddress());
         map.put(VdsProperties.SpecParams, vmDevice.getSpecParams());
         map.put(VdsProperties.NIC_TYPE, 
VmInterfaceType.forValue(nic.getType()).name());
@@ -56,6 +54,7 @@
             map.put(VdsProperties.BootOrder, 
String.valueOf(vmDevice.getBootOrder()));
         }
 
+        VmInfoBuilder.addProfileDataToNic(map, getParameters().getVm(), 
vmDevice, nic);
         VmInfoBuilder.addNetworkFiltersToNic(map, clusterVersion);
         return map;
     }
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
index 983aa0f..e31bb12 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
@@ -548,8 +548,7 @@
             vnicProfile = 
DbFacade.getInstance().getVnicProfileDao().get(nic.getVnicProfileId());
             if (vnicProfile != null) {
                 network = 
DbFacade.getInstance().getNetworkDao().get(vnicProfile.getNetworkId());
-                addQosForDevice((Map<String, Object>) 
struct.get(VdsProperties.SpecParams),
-                        vnicProfile, vm.getVdsGroupCompatibilityVersion());
+                addQosForDevice(struct, vnicProfile, 
vm.getVdsGroupCompatibilityVersion());
             }
         }
 
@@ -568,14 +567,19 @@
 
     }
 
-    private static void addQosForDevice(Map<String, Object> specParams, 
VnicProfile vnicProfile, Version vdsGroupCompatibilityVersion) {
+    private static void addQosForDevice(Map<String, Object> struct,
+            VnicProfile vnicProfile,
+            Version vdsGroupCompatibilityVersion) {
         if (FeatureSupported.networkQoS(vdsGroupCompatibilityVersion)
                 && vnicProfile.getNetworkQosId() != null) {
             NetworkQoS networkQoS = 
DbFacade.getInstance().getQosDao().get(vnicProfile.getNetworkQosId());
             if (networkQoS != null) {
+                Map<String, Object> specParams = (Map<String, Object>) 
struct.get(VdsProperties.SpecParams);
                 if (specParams == null) {
                     specParams = new HashMap<>();
+                    struct.put(VdsProperties.SpecParams, specParams);
                 }
+
                 addQosData(specParams, VdsProperties.QOS_INBOUND,
                         networkQoS.getInboundAverage(),
                         networkQoS.getInboundPeak(),


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

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

Reply via email to