Alona Kaplan has uploaded a new change for review. Change subject: engine: adding base_interface column to vds_interface table ......................................................................
engine: adding base_interface column to vds_interface table Accept vlan devices identified by any name [1] If the interface is vlan the colums will contain the base interface name. Change-Id: I87ac5121b9e7d3b74f5557336e5d504ef91b7702 Signed-off-by: Alona Kaplan <[email protected]> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VdsNetworkInterface.java M backend/manager/modules/dal/src/test/resources/fixtures.xml M packaging/dbscripts/create_views.sql M packaging/dbscripts/network_sp.sql A packaging/dbscripts/upgrade/03_05_0150_add_base_interface_column_to_vds_interfaces.sql 5 files changed, 42 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/26605/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VdsNetworkInterface.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VdsNetworkInterface.java index f3bbcd6..b172336 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VdsNetworkInterface.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VdsNetworkInterface.java @@ -35,6 +35,7 @@ @Pattern(regexp = ValidationUtils.IP_PATTERN, message = "NETWORK_ADDR_IN_GATEWAY_BAD_FORMAT") private String gateway; + private String baseInterface; private Integer vlanId; private Boolean bonded; private String bondName; @@ -201,6 +202,25 @@ */ public String getGateway() { return gateway; + } + + /** + * If the interface is vlan set its base interface name + * + * @param baseInterface + * the base interface name + */ + public void setBaseInterface(String baseInterface) { + this.baseInterface = baseInterface; + } + + /** + * Returns the base interface name. + * + * @return baseInterface + */ + public String getBaseInterface() { + return baseInterface; } /** @@ -376,6 +396,8 @@ .append(getMacAddress()) .append(", networkName=") .append(getNetworkName()) + .append(", baseInterface=") + .append(getBaseInterface()) .append(", vlanId=") .append(getVlanId()) .append(", bonded=") @@ -428,6 +450,7 @@ result = prime * result + mtu; result = prime * result + ((subnet == null) ? 0 : subnet.hashCode()); result = prime * result + ((vdsId == null) ? 0 : vdsId.hashCode()); + result = prime * result + ((baseInterface == null) ? 0 : baseInterface.hashCode()); result = prime * result + ((vlanId == null) ? 0 : vlanId.hashCode()); result = prime * result + ((qos == null) ? 0 : qos.hashCode()); result = prime * result + (qosOverridden ? 1231 : 1237); @@ -515,6 +538,13 @@ } else if (!vdsId.equals(other.vdsId)) { return false; } + if (baseInterface == null) { + if (other.baseInterface != null) { + return false; + } + } else if (!baseInterface.equals(other.baseInterface)) { + return false; + } if (vlanId == null) { if (other.vlanId != null) { return false; diff --git a/backend/manager/modules/dal/src/test/resources/fixtures.xml b/backend/manager/modules/dal/src/test/resources/fixtures.xml index 4443009..37956ca 100644 --- a/backend/manager/modules/dal/src/test/resources/fixtures.xml +++ b/backend/manager/modules/dal/src/test/resources/fixtures.xml @@ -4394,6 +4394,7 @@ <column>is_bond</column> <column>bond_name</column> <column>bond_type</column> + <column>base_interface</column> <column>vlan_id</column> <column>speed</column> <column>addr</column> @@ -4411,6 +4412,7 @@ <value>engine</value> <value>afce7a39-8e8c-4819-ba9c-796d316592e6</value> <value>78:E7:D1:E4:8C:70</value> + <null /> <null /> <null /> <null /> @@ -4436,6 +4438,7 @@ <null /> <null /> <null /> + <null /> <value>1000</value> <value>10.35.110.13</value> <value>255.255.255.0</value> @@ -4457,6 +4460,7 @@ <null /> <null /> <null /> + <null /> <value>1000</value> <value>10.35.110.11</value> <value>255.255.255.0</value> @@ -4478,6 +4482,7 @@ <null /> <null /> <null /> + <null /> <value>1000</value> <value>10.35.110.12</value> <value>255.255.255.0</value> diff --git a/packaging/dbscripts/create_views.sql b/packaging/dbscripts/create_views.sql index e7e96a3..fe5db5b 100644 --- a/packaging/dbscripts/create_views.sql +++ b/packaging/dbscripts/create_views.sql @@ -898,7 +898,7 @@ CREATE OR REPLACE VIEW vds_interface_view AS SELECT vds_interface_statistics.rx_rate, vds_interface_statistics.tx_rate, vds_interface_statistics.rx_drop, vds_interface_statistics.tx_drop, vds_interface_statistics.iface_status, vds_interface.type, vds_interface.gateway, - vds_interface.subnet, vds_interface.addr, vds_interface.speed, vds_interface.vlan_id, vds_interface.bond_type, + vds_interface.subnet, vds_interface.addr, vds_interface.speed, vds_interface.base_interface, vds_interface.vlan_id, vds_interface.bond_type, vds_interface.bond_name, vds_interface.is_bond, vds_interface.bond_opts, vds_interface.mac_addr, vds_interface.network_name, vds_interface.name, vds_static.vds_id, vds_static.vds_name, vds_interface.id, vds_interface.boot_protocol, vds_interface.mtu as mtu, vds_interface.bridged, 1 AS is_vds, vds_interface.qos_overridden AS qos_overridden, diff --git a/packaging/dbscripts/network_sp.sql b/packaging/dbscripts/network_sp.sql index 02acfc5..efe1cfa 100644 --- a/packaging/dbscripts/network_sp.sql +++ b/packaging/dbscripts/network_sp.sql @@ -300,6 +300,7 @@ v_boot_protocol INTEGER , v_type INTEGER , v_vds_id UUID, + v_base_interface VARCHAR(50) , v_vlan_id INTEGER, v_mtu INTEGER, v_bridged BOOLEAN, @@ -308,8 +309,8 @@ RETURNS VOID AS $procedure$ BEGIN -INSERT INTO vds_interface(addr, bond_name, bond_type, gateway, id, is_bond, bond_opts, mac_addr, name, network_name, speed, subnet, boot_protocol, type, VDS_ID, vlan_id, mtu, bridged, qos_overridden, labels) - VALUES(v_addr, v_bond_name, v_bond_type, v_gateway, v_id, v_is_bond, v_bond_opts, v_mac_addr, v_name, v_network_name, v_speed, v_subnet, v_boot_protocol, v_type, v_vds_id, v_vlan_id, v_mtu, v_bridged, v_qos_overridden, v_labels); +INSERT INTO vds_interface(addr, bond_name, bond_type, gateway, id, is_bond, bond_opts, mac_addr, name, network_name, speed, subnet, boot_protocol, type, VDS_ID, base_interface, vlan_id, mtu, bridged, qos_overridden, labels) + VALUES(v_addr, v_bond_name, v_bond_type, v_gateway, v_id, v_is_bond, v_bond_opts, v_mac_addr, v_name, v_network_name, v_speed, v_subnet, v_boot_protocol, v_type, v_vds_id, v_base_interface, v_vlan_id, v_mtu, v_bridged, v_qos_overridden, v_labels); END; $procedure$ LANGUAGE plpgsql; @@ -332,6 +333,7 @@ v_boot_protocol INTEGER , v_type INTEGER , v_vds_id UUID, + v_base_interface VARCHAR(50), v_vlan_id INTEGER, v_mtu INTEGER, v_bridged BOOLEAN, @@ -347,7 +349,7 @@ is_bond = v_is_bond,bond_opts = v_bond_opts,mac_addr = v_mac_addr, name = v_name,network_name = v_network_name,speed = v_speed, subnet = v_subnet,boot_protocol = v_boot_protocol, - type = v_type,VDS_ID = v_vds_id,vlan_id = v_vlan_id,_update_date = LOCALTIMESTAMP, mtu = v_mtu, + type = v_type,VDS_ID = v_vds_id,base_interface = v_base_interface,vlan_id = v_vlan_id,_update_date = LOCALTIMESTAMP, mtu = v_mtu, bridged = v_bridged, qos_overridden = v_qos_overridden, labels = v_labels WHERE id = v_id; END; $procedure$ diff --git a/packaging/dbscripts/upgrade/03_05_0150_add_base_interface_column_to_vds_interfaces.sql b/packaging/dbscripts/upgrade/03_05_0150_add_base_interface_column_to_vds_interfaces.sql new file mode 100644 index 0000000..df0bac2 --- /dev/null +++ b/packaging/dbscripts/upgrade/03_05_0150_add_base_interface_column_to_vds_interfaces.sql @@ -0,0 +1 @@ +select fn_db_add_column('vds_interface', 'base_interface', 'varchar(50)'); -- To view, visit http://gerrit.ovirt.org/26605 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I87ac5121b9e7d3b74f5557336e5d504ef91b7702 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
