From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 307171FF180 for ; Fri, 1 Aug 2025 14:09:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CDDE618413; Fri, 1 Aug 2025 14:10:32 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Fri, 1 Aug 2025 14:10:27 +0200 Message-ID: <20250801121029.201766-4-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250801121029.201766-1-s.hanreich@proxmox.com> References: <20250801121029.201766-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.194 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [ipams.pm, pveplugin.pm] Subject: [pve-devel] [PATCH pve-network 1/1] ipam: remove fallback code for ipam.db and mac cache X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" With the upgrade to PVE 9, those files should have been successfully migrated on all nodes, so we do not need to fallback on the old files anymore. Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Ipams.pm | 30 +------------------------- src/PVE/Network/SDN/Ipams/PVEPlugin.pm | 28 +----------------------- 2 files changed, 2 insertions(+), 56 deletions(-) diff --git a/src/PVE/Network/SDN/Ipams.pm b/src/PVE/Network/SDN/Ipams.pm index 7ec0f06..00aa20c 100644 --- a/src/PVE/Network/SDN/Ipams.pm +++ b/src/PVE/Network/SDN/Ipams.pm @@ -21,35 +21,7 @@ PVE::Network::SDN::Ipams::PhpIpamPlugin->register(); PVE::Network::SDN::Ipams::Plugin->init(); my $macdb_filename = "sdn/mac-cache.json"; -my $macdb_filename_legacy = 'priv/macs.db'; - -cfs_register_file( - $macdb_filename, - sub { - my ($filename, $data) = @_; - if (defined($data)) { - return json_reader($filename, $data); - } else { - # TODO: remove legacy cache file handling with PVE 9+ after ensuring all call sites got - # switched over. - return cfs_read_file($macdb_filename_legacy); - } - }, - sub { - my ($filename, $data) = @_; - # TODO: remove below with PVE 9+, add a pve8to9 check to allow doing so. - if (-e $macdb_filename_legacy && -e $macdb_filename) { - # only clean-up if we succeeded to write the new path at least once - unlink $macdb_filename_legacy - or $!{ENOENT} - or warn "failed to unlink legacy MAC cache - $!\n"; - } - return json_writer->($filename, $data); - }, -); - -# drop reading $macdb_filename_legacy with PVE 9+ - for now do not write it anymore. -cfs_register_file($macdb_filename_legacy, \&json_reader, undef); +cfs_register_file($macdb_filename, \&json_reader, \&json_writer); sub json_reader { my ($filename, $data) = @_; diff --git a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm index 6764d79..d2aba1e 100644 --- a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm +++ b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm @@ -14,37 +14,11 @@ use Digest::SHA; use base('PVE::Network::SDN::Ipams::Plugin'); my $ipamdb_file = "sdn/pve-ipam-state.json"; -my $ipamdb_file_legacy = "priv/ipam.db"; PVE::Cluster::cfs_register_file( $ipamdb_file, - sub { - my ($filename, $data) = @_; - if (defined($data)) { - return PVE::Network::SDN::Ipams::PVEPlugin->parse_config($filename, $data); - } else { - # TODO: remove legacy state file handling with PVE 9+ after ensuring all call sites got - # switched over. - return cfs_read_file($ipamdb_file_legacy); - } - }, - sub { - my ($filename, $data) = @_; - # TODO: remove below with PVE 9+, add a pve8to9 check to allow doing so. - if (-e $ipamdb_file_legacy && -e $ipamdb_file) { - # only clean-up if we succeeded to write the new path at least once - unlink $ipamdb_file_legacy - or $!{ENOENT} - or warn "failed to unlink legacy IPAM DB - $!\n"; - } - return PVE::Network::SDN::Ipams::PVEPlugin->write_config($filename, $data); - }, -); - -PVE::Cluster::cfs_register_file( - $ipamdb_file_legacy, sub { PVE::Network::SDN::Ipams::PVEPlugin->parse_config(@_); }, - undef, # no writer for legacy file, all must go to the new file. + sub { PVE::Network::SDN::Ipams::PVEPlugin->write_config(@_); }, ); sub type { -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel