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 617681FF186 for ; Fri, 29 Aug 2025 14:43:29 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AD7002E369; Fri, 29 Aug 2025 14:43:39 +0200 (CEST) Date: Fri, 29 Aug 2025 14:43:06 +0200 Message-Id: Cc: "pve-devel" From: =?utf-8?q?Michael_K=C3=B6ppl?= To: "Proxmox VE development discussion" Mime-Version: 1.0 X-Mailer: aerc 0.20.1 References: <20250821143705.256562-1-d.kral@proxmox.com> <20250821143705.256562-5-d.kral@proxmox.com> In-Reply-To: <20250821143705.256562-5-d.kral@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1756471378684 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.023 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 Subject: Re: [pve-devel] [PATCH ha-manager 04/18] rules: resource affinity: inter-consistency check with merged positive rules 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" One nit inline On Thu Aug 21, 2025 at 4:35 PM CEST, Daniel Kral wrote: > @@ -248,58 +255,6 @@ __PACKAGE__->register_check( > > =cut > > -my $sort_by_lowest_resource_id = sub { > - my ($rules) = @_; > - > - my $lowest_rule_resource_id = {}; > - for my $ruleid (keys %$rules) { > - my @rule_resources = sort keys $rules->{$ruleid}->{resources}->%*; > - $lowest_rule_resource_id->{$ruleid} = $rule_resources[0]; > - } > - > - # sort rules such that rules with the lowest numbered resource come first > - my @sorted_ruleids = sort { > - $lowest_rule_resource_id->{$a} cmp $lowest_rule_resource_id->{$b} > - } sort keys %$rules; > - > - return @sorted_ruleids; > -}; > - > -# returns a list of hashes, which contain disjoint resource affinity rules, i.e., > -# put resource affinity constraints on disjoint sets of resources > -my $find_disjoint_resource_affinity_rules = sub { > - my ($rules) = @_; > - > - my @disjoint_rules = (); > - > - # order needed so that it is easier to check whether there is an overlap > - my @sorted_ruleids = $sort_by_lowest_resource_id->($rules); > - > - for my $ruleid (@sorted_ruleids) { > - my $rule = $rules->{$ruleid}; > - > - my $found = 0; > - for my $entry (@disjoint_rules) { > - next if sets_are_disjoint($rule->{resources}, $entry->{resources}); > - > - $found = 1; > - push @{ $entry->{ruleids} }, $ruleid; > - $entry->{resources}->{$_} = 1 for keys $rule->{resources}->%*; > - > - last; > - } > - if (!$found) { > - push @disjoint_rules, > - { > - ruleids => [$ruleid], > - resources => { $rule->{resources}->%* }, > - }; > - } > - } > - > - return @disjoint_rules; > -}; > - nit: I think the removal of this would have been better to do in the previous patch. It's not really related to the changes made in this patch AFAICT and the function is not used anymore at this point. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel