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 492F71FF15E for ; Tue, 20 Jan 2026 10:35:26 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 831AE9595; Tue, 20 Jan 2026 10:35:34 +0100 (CET) Message-ID: <97862bcf-38f4-49d7-b0aa-c31293343386@proxmox.com> Date: Tue, 20 Jan 2026 10:35:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Daniel Kral , Proxmox VE development discussion References: <20251215155334.476984-1-d.kral@proxmox.com> <20251215155334.476984-7-d.kral@proxmox.com> <673bbd53-e8af-4f60-bec9-e43871950261@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: 1768901676427 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.015 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 6/9] config, manager: factor out resource motion info logic 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" Am 20.01.26 um 10:25 AM schrieb Daniel Kral: > On Mon Jan 19, 2026 at 4:24 PM CET, Daniel Kral wrote: >> On Mon Jan 19, 2026 at 4:00 PM CET, Fiona Ebner wrote: >>> Am 15.12.25 um 4:55 PM schrieb Daniel Kral: >>>> The logic in execute_migration(...) and get_resource_motion_info(...) to >>>> gather dependent and blocking HA resources is equivalent and should also >>>> be the same for consistency, so factor them out as a separate helper. >>>> >>>> The PVE::HA::Helpers package is introduced since there does not exist a >>>> package for shared logic between packages, which cannot depend on each >>>> other (e.g. Manager and Config, LRM and CRM, etc.) and PVE::HA::Tools is >>>> not the right place for these. >>> >>> It is a rather specific helper and PVE::HA::Helpers sounds very general. >>> Could we also put it in PVE::HA::Rules::Helpers or somewhere else below >>> PVE::HA::Rules or is there a good reason not to? >> >> Not really, I've thought of PVE::HA::Rules::Helpers as a module for >> helpers for the rules themselves instead of users of the rules, but it >> makes sense to share rules-related helpers in a single module, so I'll >> move it there too. > > Oh wait, just noticed that this would create a circular dependency, > because get_resource_motion_info(...) uses get_affinitive_resources(...) > from PVE::HA::Rules::ResourceAffinity, and > PVE::HA::Rules::ResourceAffinity in turn uses PVE::HA::Rules::Helpers > again.. > > I'd tend to let get_resource_motion_info(...) stay in PVE::HA::Helpers, > or do you have other ideas? Okay, so get_resource_motion_info() depends on: PVE::HA::Rules::NodeAffinity PVE::HA::Rules::ResourceAffinity And in fact, having a PVE::HA::Helpers depend on those two seems bad for moving forward, because it means that those two modules won't be able to use PVE::HA::Helpers without creating a circular dependency. Ideally, the PVE::HA::Helpers module would not have such dependencies and be usable from essentially any other HA module. So considering the two dependencies, what about putting get_resource_motion_info() in PVE::HA::Rules itself? It is a more top-level function that depends on the rule submodules, so that seems to be a fitting place. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel