public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] net: Skip and warn of interfaces without bridge
Date: Wed, 12 Apr 2023 10:45:13 +0200	[thread overview]
Message-ID: <20230412084513.1684882-1-c.ebner@proxmox.com> (raw)

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@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





             reply	other threads:[~2023-04-12  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12  8:45 Christian Ebner [this message]
2023-06-06 16:27 ` [pve-devel] applied: " Thomas Lamprecht

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=20230412084513.1684882-1-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal