[pve-devel] [PATCH ifupdown2 2/3] patch: don't remove bridge if tap|veth|fw are connected
Alexandre Derumier
aderumier at odiso.com
Thu Jun 13 14:48:54 CEST 2019
instead make a warning
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
...bridge-is-tap-veth-are-still-plugged.patch | 34 +++++++++++++++++++
.../pve/0007-add-uplink-id-option.patch | 29 ++++++++++++++++
debian/patches/series | 1 +
3 files changed, 64 insertions(+)
create mode 100644 debian/patches/pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
create mode 100644 debian/patches/pve/0007-add-uplink-id-option.patch
diff --git a/debian/patches/pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch b/debian/patches/pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
new file mode 100644
index 0000000..982537e
--- /dev/null
+++ b/debian/patches/pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
@@ -0,0 +1,34 @@
+From d4dd66be9bf4495c0dbf98d878d9121d7ed12b2f Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier at odiso.com>
+Date: Thu, 13 Jun 2019 14:34:59 +0200
+Subject: [PATCH] don't remove bridge is tap|veth are still plugged
+
+Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
+---
+ ifupdown2/ifupdown/ifupdownmain.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/ifupdown2/ifupdown/ifupdownmain.py b/ifupdown2/ifupdown/ifupdownmain.py
+index f520994..9f7641a 100644
+--- a/ifupdown2/ifupdown/ifupdownmain.py
++++ b/ifupdown2/ifupdown/ifupdownmain.py
+@@ -2067,7 +2067,15 @@ class ifupdownMain(ifupdownBase):
+ # append it to the down list
+ newifaceobjlist = new_ifaceobjdict.get(ifname)
+ if not newifaceobjlist:
+- ifacedownlist.append(ifname)
++ removebridge = 0
++ if (ifaceLinkKind.to_str(lastifaceobjlist[0].link_kind) == 'bridge'):
++ runningbridgeports = os.listdir('/sys/class/net/%s/brif/' % ifname)
++ for bport in runningbridgeports:
++ if re.match('^(tap|veth|fwpr)',bport):
++ self.logger.warn("cant remove bridge %s, port %s is present " %(ifname,bport))
++ removebridge = 1
++ if removebridge != 1:
++ ifacedownlist.append(ifname)
+ continue
+ # If ifaceobj was present in the old interfaces file,
+ # and does not have a config in the new interfaces file
+--
+2.20.1
+
diff --git a/debian/patches/pve/0007-add-uplink-id-option.patch b/debian/patches/pve/0007-add-uplink-id-option.patch
new file mode 100644
index 0000000..2f0bcb4
--- /dev/null
+++ b/debian/patches/pve/0007-add-uplink-id-option.patch
@@ -0,0 +1,29 @@
+From af2f2c44bea0a3a89f338d8e7cd5a8f61334a491 Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier at odiso.com>
+Date: Thu, 13 Jun 2019 14:40:17 +0200
+Subject: [PATCH] add uplink-id option
+
+Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
+---
+ ifupdown2/addons/address.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/ifupdown2/addons/address.py b/ifupdown2/addons/address.py
+index f576dc0..ce56ae6 100644
+--- a/ifupdown2/addons/address.py
++++ b/ifupdown2/addons/address.py
+@@ -111,6 +111,11 @@ class address(moduleBase):
+ 'validvals': ['yes', 'no'],
+ 'default' : 'no',
+ 'example' : ['mpls-enable yes']},
++ 'uplink-id' :
++ { 'help': 'uplink-id',
++ 'validrange' : ['1', '4096'],
++ 'example' : ['uplink-id 1']},
++
+ 'ipv6-addrgen': {
+ 'help': 'enable disable ipv6 link addrgenmode',
+ 'validvals': ['on', 'off'],
+--
+2.20.1
+
diff --git a/debian/patches/series b/debian/patches/series
index e1c1032..d2ab37f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,4 +3,5 @@ pve/0002-don-t-remove-tap-veth-fwpr-interfaces-from-bridge-on.patch
pve/0003-add-dummy-mtu-bridgevlanport-modules.patch
pve/0004-debian-fixup-networking.service.patch
pve/0005-allow-vlan-subinterface-in-a-vlan-aware-bridge.patch
+pve/0006-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
extra/0001-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
--
2.20.1
More information about the pve-devel
mailing list