Lior Vernia has uploaded a new change for review.

Change subject: engine: Persist empty QoS for VM
......................................................................

engine: Persist empty QoS for VM

This has been fixed previously for host QoS but not for VMs; in case
no QoS is assigned to a profile, an empty entry is sent (rather than
no entry).

Change-Id: Iffe16ac863d338aa82cab1248b8fb1769ac7fcd3
Bug-Url: https://bugzilla.redhat.com/1077684
Signed-off-by: Lior Vernia <lver...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
1 file changed, 12 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/28652/1

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 a5b500a..f71b250 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
@@ -622,22 +622,20 @@
             Version vdsGroupCompatibilityVersion) {
 
         Guid qosId = vnicProfile.getNetworkQosId();
-        if (qosId != null) {
-            if (!FeatureSupported.networkQoS(vdsGroupCompatibilityVersion)) {
-                return false;
-            }
-
-            Map<String, Object> specParams = (Map<String, Object>) 
struct.get(VdsProperties.SpecParams);
-            if (specParams == null) {
-                specParams = new HashMap<>();
-                struct.put(VdsProperties.SpecParams, specParams);
-            }
-            NetworkQoS networkQoS = 
DbFacade.getInstance().getQosDao().get(qosId);
-            NetworkQosMapper qosMapper =
-                    new NetworkQosMapper(specParams, 
VdsProperties.QOS_INBOUND, VdsProperties.QOS_OUTBOUND);
-            qosMapper.serialize(networkQoS);
+        if (!FeatureSupported.networkQoS(vdsGroupCompatibilityVersion)) {
+            return qosId == null;
         }
 
+        Map<String, Object> specParams = (Map<String, Object>) 
struct.get(VdsProperties.SpecParams);
+        if (specParams == null) {
+            specParams = new HashMap<>();
+            struct.put(VdsProperties.SpecParams, specParams);
+        }
+        NetworkQoS networkQoS = (qosId == null) ? new NetworkQoS() : 
DbFacade.getInstance().getQosDao().get(qosId);
+        NetworkQosMapper qosMapper =
+                new NetworkQosMapper(specParams, VdsProperties.QOS_INBOUND, 
VdsProperties.QOS_OUTBOUND);
+        qosMapper.serialize(networkQoS);
+
         return true;
     }
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffe16ac863d338aa82cab1248b8fb1769ac7fcd3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to