* [PATCH ifupdown2] d/patches: preserve OVS options on reload
@ 2026-04-25 21:36 Pavel Afonin
0 siblings, 0 replies; only message in thread
From: Pavel Afonin @ 2026-04-25 21:36 UTC (permalink / raw)
To: pve-devel
When reloading an existing OVS bridge, the openvswitch addon currently
adds the bridge and applies configured OVS options before clearing stale
bridge and interface state.
This can generate a command sequence where configured values such as
other_config entries are set first and then immediately removed again by
the following clear bridge command. As a result, OVS options configured
in /etc/network/interfaces disappear after ifreload.
Add a downstream patch that moves bridge creation and OVS option
application after the cleanup block, so stale state is cleared first and
the desired configuration is applied afterwards.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7030
Link: https://github.com/CumulusNetworks/ifupdown2/issues/344
Link: https://github.com/CumulusNetworks/ifupdown2/pull/345
Signed-off-by: Pavel Afonin <afonin.pb@yandex.ru>
---
...witch-preserve-ovs-options-on-reload.patch | 69 +++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 70 insertions(+)
create mode 100644 debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch
diff --git a/debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch b/debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch
new file mode 100644
index 0000000..be7b9ff
--- /dev/null
+++ b/debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch
@@ -0,0 +1,69 @@
+From 221cce42f29e5578a5d074f718942636d5917e97 Mon Sep 17 00:00:00 2001
+From: Pavel Afonin <afonin.pb@yandex.ru>
+Date: Sat, 25 Apr 2026 23:29:27 +0300
+Subject: [PATCH] openvswitch: preserve OVS options on reload
+
+When reloading an existing OVS bridge, the openvswitch addon currently
+adds the bridge and applies configured OVS options before clearing stale
+bridge and interface state.
+
+This can generate a command sequence where configured values such as
+other_config entries are set first and then immediately removed again by
+the following clear bridge command. As a result, OVS options configured
+in /etc/network/interfaces disappear after ifreload.
+
+Move bridge creation and OVS option application after the cleanup block,
+so stale state is cleared first and the desired configuration is applied
+afterwards. Initial bridge creation is unchanged, because the cleanup
+block only runs for existing links.
+
+Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7030
+Link: https://github.com/CumulusNetworks/ifupdown2/issues/344
+Link: https://github.com/CumulusNetworks/ifupdown2/pull/345
+
+Signed-off-by: Pavel Afonin <afonin.pb@yandex.ru>
+---
+ ifupdown2/addons/openvswitch.py | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py
+index 0a124ba..352633a 100644
+--- a/ifupdown2/addons/openvswitch.py
++++ b/ifupdown2/addons/openvswitch.py
+@@ -155,16 +155,6 @@ class openvswitch(Addon, moduleBase):
+
+ cmd_list = []
+
+- cmd = "--may-exist add-br %s"%(iface)
+- if ovsparent is not None and ovsoptions:
+- cmd = cmd + " %s" %(ovsoptions)
+-
+- cmd_list.append(cmd)
+-
+- if ovsparent is None and ovsoptions:
+- cmd = "set bridge %s %s" %(iface, ovsoptions)
+- cmd_list.append(cmd)
+-
+ #update
+ if self.cache.link_exists (iface):
+ # on update, delete active ports not in the new port list
+@@ -192,6 +182,16 @@ class openvswitch(Addon, moduleBase):
+ cmd = "--if-exists clear interface %s mtu_request external-ids other_config options"%(iface)
+ cmd_list.append(cmd)
+
++ cmd = "--may-exist add-br %s"%(iface)
++ if ovsparent is not None and ovsoptions:
++ cmd = cmd + " %s" %(ovsoptions)
++
++ cmd_list.append(cmd)
++
++ if ovsparent is None and ovsoptions:
++ cmd = "set bridge %s %s" %(iface, ovsoptions)
++ cmd_list.append(cmd)
++
+ if ovsextra is not None:
+ cmd_list.extend(ovsextra)
+
+--
+2.39.5
+
diff --git a/debian/patches/series b/debian/patches/series
index 2865533..35198f4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,4 @@ upstream/0001-use-raw-strings-for-regex-to-fix-backslash-interpret.patch
upstream/0002-vxlan-add-support-for-IPv6-vxlan-local-tunnelip.patch
pve/0014-nlmanager-read-ipv6-devconf-disable_ipv6-attribute-t.patch
pve/0015-revert-addons-bond-warn-if-sub-interface-is-detected-on-bond-slave.patch
+pve/0016-openvswitch-preserve-ovs-options-on-reload.patch
--
2.39.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-25 21:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-25 21:36 [PATCH ifupdown2] d/patches: preserve OVS options on reload Pavel Afonin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox