Alona Kaplan has uploaded a new change for review.

Change subject: engine: read 'interface' property on from HostDevListByCaps 
result
......................................................................

engine: read 'interface' property on from HostDevListByCaps result

Change-Id: Id4deae6a655fa1db96411a99a9189f975e3667dd
Signed-off-by: Alona Kaplan <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/HostDevice.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/HostDeviceDaoDbFacadeImpl.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
M packaging/dbscripts/host_device_sp.sql
A 
packaging/dbscripts/upgrade/03_06_0830_add_iface_column_to_host_device_table.sql
6 files changed, 26 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/37385/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/HostDevice.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/HostDevice.java
index bbafd49..b05044d 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/HostDevice.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/HostDevice.java
@@ -16,6 +16,7 @@
     private String vendorId;
     private String parentPhysicalFunction;
     private Integer totalVirtualFunctions;
+    private String networkInterfaceName;
     private Guid vmId;
 
     public Guid getHostId() {
@@ -98,6 +99,14 @@
         this.parentPhysicalFunction = parentPhysicalFunction;
     }
 
+    public String getNetworkInterfaceName() {
+        return networkInterfaceName;
+    }
+
+    public void setNetworkInterfaceName(String networkInterfaceName) {
+        this.networkInterfaceName = networkInterfaceName;
+    }
+
     public Integer getTotalVirtualFunctions() {
         return totalVirtualFunctions;
     }
@@ -144,6 +153,7 @@
                 ObjectUtils.objectsEqual(vendorId, other.vendorId) &&
                 ObjectUtils.objectsEqual(parentPhysicalFunction, 
other.parentPhysicalFunction) &&
                 ObjectUtils.objectsEqual(totalVirtualFunctions, 
other.totalVirtualFunctions) &&
+                ObjectUtils.objectsEqual(networkInterfaceName, 
other.networkInterfaceName) &&
                 ObjectUtils.objectsEqual(vmId, other.vmId);
     }
 
@@ -161,6 +171,7 @@
         result = prime * result + (vendorId == null ? 0 : vendorId.hashCode());
         result = prime * result + (parentPhysicalFunction == null ? 0 : 
parentPhysicalFunction.hashCode());
         result = prime * result + (totalVirtualFunctions == null ? 0 : 
totalVirtualFunctions.hashCode());
+        result = prime * result + (networkInterfaceName == null ? 0 : 
networkInterfaceName.hashCode());
         result = prime * result + (vmId == null ? 0 :  vmId.hashCode());
         return result;
     }
@@ -168,7 +179,7 @@
     @Override
     public String toString() {
         return String.format("HostDevice{hostId=%s, deviceName='%s', 
parentDeviceName='%s', capability='%s', iommuGroup=%d, " +
-                "productName='%s', productId='%s', vendorName='%s', 
vendorId='%s', parentPhysicalFunction='%s', totalVirtualFunctions=%s, vmId=%s}",
-                hostId, deviceName, parentDeviceName, capability, iommuGroup, 
productName, productId, vendorName, vendorId, parentPhysicalFunction, 
totalVirtualFunctions, vmId);
+                "productName='%s', productId='%s', vendorName='%s', 
vendorId='%s', parentPhysicalFunction='%s', totalVirtualFunctions=%s, 
networkInterfaceName='%s', vmId=%s}",
+                hostId, deviceName, parentDeviceName, capability, iommuGroup, 
productName, productId, vendorName, vendorId, parentPhysicalFunction, 
totalVirtualFunctions, networkInterfaceName, vmId);
     }
 }
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/HostDeviceDaoDbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/HostDeviceDaoDbFacadeImpl.java
index 9c52ce3..0c7bea6 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/HostDeviceDaoDbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/HostDeviceDaoDbFacadeImpl.java
@@ -36,6 +36,7 @@
                 .addValue("vendor_id", entity.getVendorId())
                 .addValue("physfn", entity.getParentPhysicalFunction())
                 .addValue("total_vfs", entity.getTotalVirtualFunctions())
+                .addValue("net_ifac_name", entity.getNetworkInterfaceName())
                 .addValue("vm_id", entity.getVmId());
     }
 
@@ -75,6 +76,7 @@
             device.setVendorId(rs.getString("vendor_id"));
             device.setParentPhysicalFunction(rs.getString("physfn"));
             device.setTotalVirtualFunctions((Integer) 
rs.getObject("total_vfs"));
+            device.setNetworkInterfaceName(rs.getString("net_iface_name"));
             device.setVmId(getGuid(rs, "vm_id"));
 
             return device;
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
index 06b1ad83..b86537c 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
@@ -1892,6 +1892,9 @@
             if (params.containsKey(VdsProperties.TOTAL_VFS)) {
                 
device.setTotalVirtualFunctions(Integer.parseInt(params.get(VdsProperties.TOTAL_VFS).toString()));
             }
+            if (params.containsKey(VdsProperties.NET_INTERFACE_NAME)) {
+                
device.setNetworkInterfaceName(params.get(VdsProperties.NET_INTERFACE_NAME).toString());
+            }
 
             // if the device is attached to running VM, the `vmId` property 
will be set
             if (entry.getValue().containsKey(VdsProperties.VM_ID)) {
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
index efe031b..91bd502 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
@@ -399,6 +399,7 @@
     public static final String PARENT_NAME = "parent";
     public static final String PHYSICAL_FUNCTION = "physfn";
     public static final String TOTAL_VFS = "totalvfs";
+    public static final String NET_INTERFACE_NAME = "interface";
 
     // fencing policy parameters
     public static final String STORAGE_DOMAIN_HOST_ID_MAP = 
"storageDomainHostIdMap";
diff --git a/packaging/dbscripts/host_device_sp.sql 
b/packaging/dbscripts/host_device_sp.sql
index 8fbd6d0..c05b3d4 100644
--- a/packaging/dbscripts/host_device_sp.sql
+++ b/packaging/dbscripts/host_device_sp.sql
@@ -10,6 +10,7 @@
   v_vendor_id VARCHAR(255),
   v_physfn VARCHAR(255),
   v_total_vfs INTEGER,
+  v_net_iface_name VARCHAR(255),
   v_vm_id UUID)
 RETURNS VOID
 AS $procedure$
@@ -27,6 +28,7 @@
     vendor_id,
     physfn,
     total_vfs,
+    net_iface_name,
     vm_id)
   VALUES(
     v_host_id,
@@ -40,6 +42,7 @@
     v_vendor_id,
     v_physfn,
     v_total_vfs,
+    v_net_iface_name,
     v_vm_id
   );
 END; $procedure$
@@ -57,6 +60,7 @@
   v_vendor_id VARCHAR(255),
   v_physfn VARCHAR(255),
   v_total_vfs INTEGER,
+  v_net_iface_name VARCHAR(255),
   v_vm_id UUID)
 RETURNS VOID
 AS $procedure$
@@ -75,6 +79,7 @@
     vendor_id = v_vendor_id,
     physfn = v_physfn,
     total_vfs = v_total_vfs,
+    net_iface_name = v_net_iface_name,
     vm_id = v_vm_id
   WHERE host_id = v_host_id AND device_name = v_device_name;
 END; $procedure$
diff --git 
a/packaging/dbscripts/upgrade/03_06_0830_add_iface_column_to_host_device_table.sql
 
b/packaging/dbscripts/upgrade/03_06_0830_add_iface_column_to_host_device_table.sql
new file mode 100644
index 0000000..8d0b988
--- /dev/null
+++ 
b/packaging/dbscripts/upgrade/03_06_0830_add_iface_column_to_host_device_table.sql
@@ -0,0 +1,2 @@
+select fn_db_add_column('host_device', 'net_iface_name', 'VARCHAR(255)');
+


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

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

Reply via email to