[pve-devel] [PATCH ifupdown2 6/9] add extra patch: 0003-ovs-multiple-ovsport.patch

Alexandre Derumier aderumier at odiso.com
Thu May 28 14:33:22 CEST 2020


https://github.com/CumulusNetworks/ifupdown2/pull/164
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 .../extra/0003-ovs-multiple-ovsport.patch     | 53 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 54 insertions(+)
 create mode 100644 debian/patches/extra/0003-ovs-multiple-ovsport.patch

diff --git a/debian/patches/extra/0003-ovs-multiple-ovsport.patch b/debian/patches/extra/0003-ovs-multiple-ovsport.patch
new file mode 100644
index 0000000..bb18056
--- /dev/null
+++ b/debian/patches/extra/0003-ovs-multiple-ovsport.patch
@@ -0,0 +1,53 @@
+From 6cdb2b3d220fdf60ea8d0a2982a90c583dec467e Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier at odiso.com>
+Date: Thu, 28 May 2020 11:21:55 +0200
+Subject: [PATCH] addons: openvswitch: allow multiple ovs-ports + glob/regex
+
+---
+ ifupdown2/addons/openvswitch.py | 18 +++++++++++++++---
+ 1 file changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py
+index 468d7df..936c871 100644
+--- a/ifupdown2/addons/openvswitch.py
++++ b/ifupdown2/addons/openvswitch.py
+@@ -37,6 +37,12 @@ class openvswitch(Addon, moduleBase):
+                 'help': 'Interfaces to be part of this ovs bridge.',
+                 'validvals': ['<interface-list>'],
+                 'required': False,
++                "multivalue": True,
++                "example": [
++                    "ovs-ports swp1.100 swp2.100 swp3.100",
++                    "ovs-ports glob swp1-3.100",
++                    "ovs-ports regex (swp[1|2|3].100)"
++                ]
+             },
+             'ovs-type': {
+                 'help': 'ovs interface type',
+@@ -87,10 +93,15 @@ def _is_ovs_bridge (self, ifaceobj):
+         return False
+ 
+     def _get_ovs_ports (self, ifaceobj):
+-        ovs_ports = ifaceobj.get_attr_value_first('ovs-ports')
++        ovs_ports = []
++
++        for port in ifaceobj.get_attr_value('ovs-ports') or []:
++            ovs_ports.extend(port.split())
++
+         if ovs_ports:
+-            return sorted (ovs_ports.split ())
+-        return None
++            return self.parse_port_list(ifaceobj.name, ' '.join(ovs_ports))
++        else:
++            return None
+ 
+     def _get_running_ovs_ports (self, iface):
+         output = utils.exec_command("/usr/bin/ovs-vsctl list-ports %s" %iface)
+@@ -152,6 +163,7 @@ def _addbridge (self, ifaceobj):
+             ovs_ports = self._get_ovs_ports(ifaceobj)
+             running_ovs_ports = self._get_running_ovs_ports(iface)
+ 
++            missingports = []
+             if running_ovs_ports is not None and ovs_ports is not None:
+                 missingports = list(set(running_ovs_ports) - set(ovs_ports))
+ 
diff --git a/debian/patches/series b/debian/patches/series
index e57723c..e6a1270 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,6 @@
 extra/0001-ovs-ovs-ports-condone-regex.patch
 extra/0002-nllistener-increase-buffer.patch
+extra/0003-ovs-multiple-ovsport.patch
 pve/0001-don-t-remove-tap-veth-fwpr-interfaces-from-bridge-on.patch
 pve/0002-add-dummy-mtu-bridgevlanport-modules.patch
 pve/0003-allow-vlan-subinterface-in-a-vlan-aware-bridge.patch
-- 
2.20.1




More information about the pve-devel mailing list