public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] inotify: avoid cyclic use statement
@ 2024-08-02 11:53 Fiona Ebner
  0 siblings, 0 replies; only message in thread
From: Fiona Ebner @ 2024-08-02 11:53 UTC (permalink / raw)
  To: pve-devel

Commit e68ebda ("fix #545: interfaces: allow arbitrary bridge names in
network config") introduced a cyclic usage between
PVE::RESTEnvironment and PVE::INotify, making code like the following
fail:

> perl -e "use PVE::RESTEnvironment qw(log_warn);"

Note, including the PVE::INotify module first would still work, i.e.:

> perl -e "use PVE::INotify; use PVE::RESTEnvironment qw(log_warn);"

The rest of the PVE::INotify module alredy uses syslog(), which could
be used here as well to get rid of the cyclic usage. Wolfgang argued
that the whole point of commit e68ebda was to remove coupling between
the name and the type of the interface. If there still is some code
about a name starting with 'vmbr' being classified wrong, that should
rather be fixed. Because of the very commit, the frontend already
doesn't show e.g. a non-bridge with name 'vmbr7' in bridge selectors.

Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: e68ebda ("fix #545: interfaces: allow arbitrary bridge names in network config")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

@Stefan: Do you have any good rationale to rather keep the check?

 src/PVE/INotify.pm | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 8a4a810..e7c55f6 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -22,7 +22,6 @@ use PVE::Network;
 use PVE::ProcFSTools;
 use PVE::SafeSyslog;
 use PVE::Tools;
-use PVE::RESTEnvironment qw(log_warn);
 
 use base 'Exporter';
 
@@ -1145,9 +1144,6 @@ sub __read_etc_network_interfaces {
 	    }
 	}
 
-	log_warn("detected a interface $iface that is not a bridge!")
-	    if !($d->{type} eq 'OVSBridge' || $d->{type} eq 'bridge') && $iface =~ m/^vmbr\d+$/;
-
 	# map address and netmask to cidr
 	if (my $addr = $d->{address}) {
 	    if (_address_is_cidr($addr)) {
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-02 11:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-02 11:53 [pve-devel] [PATCH common] inotify: avoid cyclic use statement Fiona Ebner

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