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 F0FF41FF17A for ; Fri, 4 Jul 2025 20:20:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B97B43D534; Fri, 4 Jul 2025 20:21:10 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Fri, 4 Jul 2025 20:20:44 +0200 Message-Id: <20250704182102.467624-2-d.kral@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250704182102.467624-1-d.kral@proxmox.com> References: <20250704182102.467624-1-d.kral@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.012 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH ha-manager v3 01/13] rules: introduce plugin-specific canonicalize routines 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" These are needed by the resource affinity rule type in an upcoming patch, which needs to make changes to the existing rule set to properly synthesize inferred rules after the rule set is already made feasible. Signed-off-by: Daniel Kral --- src/PVE/HA/Rules.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/PVE/HA/Rules.pm b/src/PVE/HA/Rules.pm index bda0b5d..39c349d 100644 --- a/src/PVE/HA/Rules.pm +++ b/src/PVE/HA/Rules.pm @@ -354,6 +354,18 @@ sub check_feasibility : prototype($$) { return $global_errors; } +=head3 $class->plugin_canonicalize($rules) + +B Can be implemented in the I. + +Modifies the C<$rules> to a plugin-specific canonical form. + +=cut + +sub plugin_canonicalize : prototype($$) { + my ($class, $rules) = @_; +} + =head3 $class->canonicalize($rules) Modifies C<$rules> to contain only feasible rules. @@ -385,6 +397,12 @@ sub canonicalize : prototype($$) { } } + for my $type (@$types) { + my $plugin = $class->lookup($type); + eval { $plugin->plugin_canonicalize($rules) }; + next if $@; # plugin doesn't implement plugin_canonicalize(...) + } + return $messages; } -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel