Eliraz Levi has uploaded a new change for review.

Change subject: engine: adding QoS network name to vmNetworkInterface entity
......................................................................

engine: adding QoS network name to vmNetworkInterface entity

Change-Id: Id8480381c42626bba80284345bee8b437b77b7fc
Bug-Url: https://bugzilla.redhat.com/1103493
Signed-off-by: Eliraz Levi <el...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VmNetworkInterface.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNetworkInterfaceDaoDbFacadeImpl.java
M packaging/dbscripts/create_views.sql
3 files changed, 24 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/04/33204/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VmNetworkInterface.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VmNetworkInterface.java
index 74e6544..5d47b8c 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VmNetworkInterface.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VmNetworkInterface.java
@@ -13,6 +13,7 @@
     private boolean portMirroring;
     private String vmName;
     private boolean plugged;
+    private String qosName;
 
     public VmNetworkInterface() {
         plugged = true;
@@ -43,6 +44,10 @@
         return vnicProfileName;
     }
 
+    public String getQosName() {
+        return qosName;
+    }
+
     public void setVnicProfileName(String vnicProfileName) {
         this.vnicProfileName = vnicProfileName;
     }
@@ -69,6 +74,10 @@
 
     public void setPlugged(boolean plugged) {
         this.plugged = plugged;
+    }
+
+    public void setQosName(String qosName) {
+        this.qosName = qosName;
     }
 
     @Override
@@ -101,6 +110,8 @@
                 .append(getVmName())
                 .append(", vmTemplateId=")
                 .append(getVmTemplateId())
+                .append(", QoSName=")
+                .append(getQosName())
                 .append("}");
         return builder.toString();
     }
@@ -114,6 +125,7 @@
         result = prime * result + (isPortMirroring() ? 1231 : 1237);
         result = prime * result + ((getVmName() == null) ? 0 : 
getVmName().hashCode());
         result = prime * result + (isPlugged() ? 1231 : 1237);
+        result = prime * result + ((getQosName() == null) ? 0 
:getQosName().hashCode());
         return result;
     }
 
@@ -129,21 +141,24 @@
             return false;
         }
         VmNetworkInterface other = (VmNetworkInterface) obj;
-        if (!ObjectUtils.objectsEqual(other.getNetworkName(), 
other.getNetworkName())) {
+        if (!ObjectUtils.objectsEqual(getNetworkName(), 
other.getNetworkName())) {
             return false;
         }
-        if (!ObjectUtils.objectsEqual(other.getVnicProfileName(), 
other.getVnicProfileName())) {
+        if (!ObjectUtils.objectsEqual(getVnicProfileName(), 
other.getVnicProfileName())) {
             return false;
         }
         if (isPortMirroring() != other.isPortMirroring()) {
             return false;
         }
-        if (!ObjectUtils.objectsEqual(other.getVmName(), other.getVmName())) {
+        if (!ObjectUtils.objectsEqual(getVmName(), other.getVmName())) {
             return false;
         }
         if (isPlugged() != other.isPlugged()) {
             return false;
         }
+        if (!ObjectUtils.objectsEqual(getQosName(), other.getNetworkName())) {
+            return false;
+        }
 
         return true;
     }
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNetworkInterfaceDaoDbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNetworkInterfaceDaoDbFacadeImpl.java
index b1d82a2..d99da23 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNetworkInterfaceDaoDbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNetworkInterfaceDaoDbFacadeImpl.java
@@ -96,6 +96,7 @@
             entity.setVnicProfileName(rs.getString("vnic_profile_name"));
             entity.setPlugged(rs.getBoolean("is_plugged"));
             entity.setPortMirroring(rs.getBoolean("port_mirroring"));
+            entity.setQosName(rs.getString("qos_name"));
             return entity;
 
         }
diff --git a/packaging/dbscripts/create_views.sql 
b/packaging/dbscripts/create_views.sql
index 7f3cf81..f0edfcb 100644
--- a/packaging/dbscripts/create_views.sql
+++ b/packaging/dbscripts/create_views.sql
@@ -970,24 +970,26 @@
       vm_interface.mac_addr, network.name AS network_name, vm_interface.name, 
vm_interface.vnic_profile_id, vm_static.vm_guid, vm_interface.vmt_guid,
       vm_static.vm_name, vm_interface.id, 0 AS boot_protocol, 0 AS is_vds, 
vm_device.is_plugged,
       vm_device.custom_properties, vnic_profiles.port_mirroring AS 
port_mirroring, vm_interface.linked,
-      vm_static.vds_group_id AS vds_group_id, vm_static.entity_type AS 
vm_entity_type, vnic_profiles.name AS vnic_profile_name
+      vm_static.vds_group_id AS vds_group_id, vm_static.entity_type AS 
vm_entity_type, vnic_profiles.name AS vnic_profile_name, qos.name AS qos_name
   FROM vm_interface_statistics
   JOIN vm_interface ON vm_interface_statistics.id = vm_interface.id
   JOIN vm_static ON vm_interface.vm_guid = vm_static.vm_guid
   JOIN vm_device ON vm_interface.vm_guid = vm_device.vm_id AND vm_interface.id 
= vm_device.device_id
   LEFT JOIN (vnic_profiles JOIN network ON network.id = 
vnic_profiles.network_id) ON vnic_profiles.id = vm_interface.vnic_profile_id
+  LEFT JOIN qos ON vnic_profiles.network_qos_id = qos.id
   UNION
   SELECT vm_interface_statistics.rx_rate, vm_interface_statistics.tx_rate, 
vm_interface_statistics.rx_drop,
       vm_interface_statistics.tx_drop, vm_interface_statistics.iface_status, 
vm_interface.type, vm_interface.speed,
       vm_interface.mac_addr, network.name AS network_name, vm_interface.name, 
vm_interface.vnic_profile_id, NULL::uuid as vm_guid,
       vm_interface.vmt_guid, vm_templates.vm_name AS vm_name, vm_interface.id, 
0 AS boot_protocol, 0 AS is_vds,
       vm_device.is_plugged as is_plugged, vm_device.custom_properties as 
custom_properties, vnic_profiles.port_mirroring AS port_mirroring,
-      vm_interface.linked, vm_templates.vds_group_id AS vds_group_id, 
vm_templates.entity_type AS vm_entity_type, vnic_profiles.name AS 
vnic_profile_name
+      vm_interface.linked, vm_templates.vds_group_id AS vds_group_id, 
vm_templates.entity_type AS vm_entity_type, vnic_profiles.name AS 
vnic_profile_name , qos.name
   FROM vm_interface_statistics
   RIGHT JOIN vm_interface ON vm_interface_statistics.id = vm_interface.id
   JOIN vm_static AS vm_templates ON vm_interface.vmt_guid = 
vm_templates.vm_guid
   JOIN vm_device ON vm_interface.vmt_guid = vm_device.vm_id AND 
vm_interface.id = vm_device.device_id
-  LEFT JOIN (vnic_profiles JOIN network ON network.id = 
vnic_profiles.network_id) ON vnic_profiles.id = vm_interface.vnic_profile_id;
+  LEFT JOIN (vnic_profiles JOIN network ON network.id = 
vnic_profiles.network_id) ON vnic_profiles.id = vm_interface.vnic_profile_id
+  LEFT JOIN qos ON vnic_profiles.network_qos_id = qos.id;
 
 
 


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

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

Reply via email to