From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id A230A1FF183 for ; Wed, 2 Jul 2025 15:09:50 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 54A741B6D3; Wed, 2 Jul 2025 15:10:29 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Wed, 2 Jul 2025 15:09:34 +0200 Message-ID: <20250702130938.1859144-1-c.heiss@proxmox.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250702130350.1841508-1-c.heiss@proxmox.com> References: <20250702130350.1841508-1-c.heiss@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.232 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. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches 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. [firewall.pm, firewallsimulator.pm] Subject: [pve-devel] [PATCH RFC firewall 2/2] firewall: adjust to new qemu-server module structure 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" PVE::QemuServer::parse_net() was moved to PVE::QemuServer::Network in qemu-server eac162a86 ("introduce Network module"), so adjust all references here accordingly. Signed-off-by: Christoph Heiss --- This would require a corresponding `Depends` entry update in d/control. But currently, this dependency is not recorded to due being cyclic - at least according to the comment at the top of the file. I've thus marked this patch as RFC & left that change out for now - but somehow this API break must be versioned properly. Maybe someone with more insight can chime in here? src/PVE/Firewall.pm | 6 +++--- src/PVE/FirewallSimulator.pm | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm index 13112be..41b740a 100644 --- a/src/PVE/Firewall.pm +++ b/src/PVE/Firewall.pm @@ -4363,7 +4363,7 @@ sub compile_iptables_filter { foreach my $netid (sort keys %$conf) { next if $netid !~ m/^net(\d+)$/; - my $net = PVE::QemuServer::parse_net($conf->{$netid}); + my $net = PVE::QemuServer::Network::parse_net($conf->{$netid}); next if !$net->{firewall}; my $iface = "tap${vmid}i$1"; @@ -4503,7 +4503,7 @@ sub compile_ipsets { my $device_ips = {}; foreach my $netid (keys %$conf) { next if $netid !~ m/^net(\d+)$/; - my $net = PVE::QemuServer::parse_net($conf->{$netid}); + my $net = PVE::QemuServer::Network::parse_net($conf->{$netid}); next if !$net->{firewall}; if ($vmfw_conf->{options}->{ipfilter} && !$ipsets->{"ipfilter-$netid"}) { @@ -4623,7 +4623,7 @@ sub compile_ebtables_filter { foreach my $netid (sort keys %$conf) { next if $netid !~ m/^net(\d+)$/; - my $net = PVE::QemuServer::parse_net($conf->{$netid}); + my $net = PVE::QemuServer::Network::parse_net($conf->{$netid}); next if !$net->{firewall}; my $iface = "tap${vmid}i$1"; my $macaddr = $net->{macaddr}; diff --git a/src/PVE/FirewallSimulator.pm b/src/PVE/FirewallSimulator.pm index 877e646..0a3100b 100644 --- a/src/PVE/FirewallSimulator.pm +++ b/src/PVE/FirewallSimulator.pm @@ -491,7 +491,7 @@ sub extract_vm_info { my $info = { type => 'vm', vmid => $vmid }; my $conf = $vmdata->{qemu}->{$vmid} || die "no such VM '$vmid'"; - my $net = PVE::QemuServer::parse_net($conf->{"net$netnum"}); + my $net = PVE::QemuServer::Network::parse_net($conf->{"net$netnum"}); $info->{macaddr} = $net->{macaddr} || die "unable to get mac address"; $info->{bridge} = $net->{bridge} || die "unable to get bridge"; $info->{fwbr} = "fwbr${vmid}i$netnum"; -- 2.49.0 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel