all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Pavel Afonin <afonin.pb@yandex.ru>
To: pve-devel@lists.proxmox.com
Subject: [PATCH ifupdown2] d/patches: preserve OVS options on reload
Date: Sun, 26 Apr 2026 00:36:48 +0300	[thread overview]
Message-ID: <20260425213648.112422-1-afonin.pb@yandex.ru> (raw)

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




                 reply	other threads:[~2026-04-25 21:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260425213648.112422-1-afonin.pb@yandex.ru \
    --to=afonin.pb@yandex.ru \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal