From: "Rémi PAETA" <remi.paeta@comaite.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server] fix #6490: network: add bridge fdb entries when hotplugging a nic
Date: Tue, 13 Oct 2026 11:58:52 +0200 [thread overview]
Message-ID: <20261013095852.2586609-1-remi.paeta@comaite.com> (raw)
On bridges with MAC learning disabled, the forwarding database entries
of the guest NICs are added on VM start and on resume after a
migration, but not when a NIC gets hotplugged or re-plugged because its
bridge, VLAN tag or firewall setting changed. Re-plugging even drops
the existing entries.
The guest then loses connectivity on that NIC until its next start,
for example after enabling or disabling the firewall of the NIC, and
the migration of the VM fails at the end, as deleting the missing
entries fails.
Add the forwarding database entries of the NIC after plugging it. On
bridges with MAC learning enabled, this is a no-op.
Link: https://bugzilla.proxmox.com/show_bug.cgi?id=6490
Signed-off-by: Rémi PAETA <remi.paeta@comaite.com>
---
I am contributing on behalf of my employer, Comaite. Its entity CLA
was signed and sent to office@proxmox.com on 2026-10-09. Comaite would
be happy to make its first contribution to the Proxmox code with this
patch.
Tested on a Linux bridge with bridge-disable-mac-learning: toggling
the firewall of a NIC, hotplugging a NIC and live migrating the VM
afterwards. Without the patch, the NIC loses connectivity and the
migration fails on 'bridge fdb del'; with it, the entries are there
and the migration succeeds.
src/PVE/QemuServer.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 74772fdd..4c2bd334 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -5126,6 +5126,8 @@ sub vmconfig_update_net {
$newnet->{trunks},
$newnet->{rate},
);
+ # unplugging the interface dropped its forwarding database entries
+ PVE::QemuServer::Network::add_nets_bridge_fdb({ $opt => $value }, $vmid);
} elsif (safe_num_ne($oldnet->{rate}, $newnet->{rate})) {
# Rate can be applied on its own but any change above needs to
@@ -5155,6 +5157,7 @@ sub vmconfig_update_net {
$newnet->{bridge}, $newnet->{macaddr}, $vmid, $conf->{name},
);
vm_deviceplug($storecfg, $conf, $vmid, $opt, $newnet, $arch, $machine_type);
+ PVE::QemuServer::Network::add_nets_bridge_fdb({ $opt => $value }, $vmid);
} else {
die "skip\n";
}
--
2.47.3
reply other threads:[~2026-10-13 10:17 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=20261013095852.2586609-1-remi.paeta@comaite.com \
--to=remi.paeta@comaite.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox