[pve-devel] [PATCH qemu-server] net: Skip and warn of interfaces without bridge

Christian Ebner c.ebner at proxmox.com
Wed Apr 12 10:45:13 CEST 2023


Handle and warn about network interfaces which are not attached to
any bridge because the user actively removed it from the VM config.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 PVE/QemuServer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c1d0fd2..3a6c120 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -8574,6 +8574,10 @@ sub add_nets_bridge_fdb {
 	}
 
 	my $bridge = $net->{bridge};
+	if (!$bridge) {
+	    log_warn("Interface '$iface' not attached to any bridge.");
+	    next;
+	}
 	if ($have_sdn) {
 	    PVE::Network::SDN::Zones::add_bridge_fdb($iface, $mac, $bridge, $net->{firewall});
 	} elsif (-d "/sys/class/net/$bridge/bridge") { # avoid fdb management with OVS for now
-- 
2.30.2






More information about the pve-devel mailing list