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 DF1991FF17E for ; Thu, 2 Oct 2025 15:39:42 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 311BA11394; Thu, 2 Oct 2025 15:39:49 +0200 (CEST) Message-ID: <5e2e3770-80ad-4470-abdc-9ff99a4234d3@proxmox.com> Date: Thu, 2 Oct 2025 15:39:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Daniel Kral References: <20251001140253.121445-1-f.ebner@proxmox.com> <20251001140253.121445-2-f.ebner@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759412361865 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.021 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.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. 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. [config.pm] Subject: Re: [pve-devel] [PATCH ha-manager 1/1] api: relocate/migrate resource: improve initialization of variables to avoid Perl warning 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 Cc: pve-devel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 02.10.25 um 2:18 PM schrieb Daniel Kral: > On Wed Oct 1, 2025 at 4:02 PM CEST, Fiona Ebner wrote: >> diff --git a/src/PVE/HA/Config.pm b/src/PVE/HA/Config.pm >> index 301c62f..b52465f 100644 >> --- a/src/PVE/HA/Config.pm >> +++ b/src/PVE/HA/Config.pm >> @@ -397,6 +397,7 @@ sub get_resource_motion_info { >> push @$dependent_resources, $_ for sort keys %$together; >> >> for my $node (keys %$ns) { >> + $blocking_resources_by_node->{$node} = []; > > Unfortunately this breaks some callers of get_resource_motion_info(...), > which assume that a set $blocking_resources_by_node->{$node} means that > there was some blocking HA resource on that node, e.g. > > $ ha-manager crm-command migrate vm:10000 node2 > cannot migrate resource 'vm:10000' to node 'node2': Are you sure this is with the first part of my patch included? It works for me. > even though vm:10000 isn't in any HA rule. It might also break the > migrate precondition API in pve-container and qemu-server as it will not > add the node to 'allowed-nodes' there, which AFAICT we don't use in our > web interface but maybe some API users? Ah, good catch! I did not notice that there are callers outside the ha-manager package. Okay, I'll go with the other approach then for v2. > > To be fair, these users should also check whether there are any > elements in the array to be safe, but it might be less churn to make it > a ref + array ref check for both API endpoints here? > >> next if $ns->{$node} ne 'online'; >> >> for my $csid (sort keys %$separate) { _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel