Change in vdsm[ovirt-3.6]: ovs: hook: fake bridgeless networks

phoracek at redhat.com phoracek at redhat.com
Tue Mar 22 13:49:14 UTC 2016


Petr Horáček has uploaded a new change for review.

Change subject: ovs: hook: fake bridgeless networks
......................................................................

ovs: hook: fake bridgeless networks

Engine expects Display networks to be bridgeless. We can't create
bridgeless networks in OVS, but we can create them bridged and then lie
about them to engine.

Change-Id: Ia8d076a1181adc6910be13a1f7560018d3eeaa07
Signed-off-by: Petr Horáček <phoracek at redhat.com>
Bug-Url: https://bugzilla.redhat.com/1234867
---
M vdsm_hooks/ovs/ovs_after_get_caps.py
M vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
2 files changed, 16 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/55071/1

diff --git a/vdsm_hooks/ovs/ovs_after_get_caps.py b/vdsm_hooks/ovs/ovs_after_get_caps.py
index bbb8735..f74c6e7 100755
--- a/vdsm_hooks/ovs/ovs_after_get_caps.py
+++ b/vdsm_hooks/ovs/ovs_after_get_caps.py
@@ -97,7 +97,9 @@
         net_info = _get_net_info(attrs, interface, dhcpv4ifaces, dhcpv6ifaces,
                                  routes)
         net_info['iface'] = network
-        net_info['bridged'] = True
+        # if Engine expects network to be bridgeless (for Display network
+        # purposes), report it as bridgeless
+        net_info['bridged'] = attrs.get('bridged')
         net_info['ports'] = _get_ports(network, attrs)
         net_info['stp'] = _get_stp(interface)
         ovs_networks_caps[network] = net_info
@@ -109,15 +111,19 @@
     dhcpv4ifaces, dhcpv6ifaces = netinfo._get_dhclient_ifaces()
     routes = netinfo._get_routes()
     for network, attrs in iter_ovs_nets(running_config.networks):
-        interface = network if 'vlan' in attrs else BRIDGE_NAME
-        net_info = _get_net_info(attrs, interface, dhcpv4ifaces, dhcpv6ifaces,
-                                 routes)
-        net_info['bridged'] = True
-        net_info['ports'] = _get_ports(network, attrs)
-        # TODO netinfo._bridge_options does not work here
-        net_info['opts'] = {}
-        net_info['stp'] = _get_stp(interface)
-        ovs_bridges_caps[network] = net_info
+        bridged = attrs.get('bridged')
+        # if Engine expects network to be bridgeless (for Display network
+        # purposes), do not report its bridge
+        if bridged:
+            interface = network if 'vlan' in attrs else BRIDGE_NAME
+            net_info = _get_net_info(attrs, interface, dhcpv4ifaces,
+                                     dhcpv6ifaces, routes)
+            net_info['bridged'] = True
+            net_info['ports'] = _get_ports(network, attrs)
+            # TODO netinfo._bridge_options does not work here
+            net_info['opts'] = {}
+            net_info['stp'] = _get_stp(interface)
+            ovs_bridges_caps[network] = net_info
     return ovs_bridges_caps
 
 
diff --git a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
index 5f38773..88e365e 100644
--- a/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
+++ b/vdsm_hooks/ovs/ovs_before_network_setup_ovs.py
@@ -162,11 +162,8 @@
     nic = attrs.get('nic')
     bonding = attrs.get('bonding')
     vlan = attrs.get('vlan')
-    bridged = attrs.get('bridged', True)
     stp = attrs.get('stp', False)
 
-    if not bridged:
-        raise Exception('OVS does not support bridgeless networks')
     if bonding in running_config.bonds:
         if not is_ovs_bond(running_config.bonds[bonding]):
             raise Exception('%s is not OVS bonding' % bonding)


-- 
To view, visit https://gerrit.ovirt.org/55071
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8d076a1181adc6910be13a1f7560018d3eeaa07
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list