From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id E57081FF0AF for ; Fri, 20 Nov 2026 15:02:06 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7F43F21791; Fri, 20 Nov 2026 15:02:05 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Nov 2026 15:02:01 +0100 Message-Id: Subject: Re: [PATCH pve-ha-manager v2 15/19] manager: factor out crs option update helper From: "Dominik Rusovac" To: "Daniel Kral" , X-Mailer: aerc 0.20.0 References: <20261112094437.1951271-1-d.rusovac@proxmox.com> <20261112094437.1951271-16-d.rusovac@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795183321103 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.023 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZNBJB2CA4RE5IPRNUROKCKO3WL4OGAFG X-Message-ID-Hash: ZNBJB2CA4RE5IPRNUROKCKO3WL4OGAFG X-MailFrom: d.rusovac@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri Nov 20, 2026 at 2:46 PM CET, Daniel Kral wrote: > Modulo the nit, consider as: > > Reviewed-by: Daniel Kral > > On Thu Nov 12, 2026 at 10:44 AM CET, Dominik Rusovac wrote: [snip] >> diff --git a/src/PVE/HA/Manager.pm b/src/PVE/HA/Manager.pm >> index b206719..a91eec3 100644 >> --- a/src/PVE/HA/Manager.pm >> +++ b/src/PVE/HA/Manager.pm >> @@ -99,6 +99,25 @@ sub new { >> return $self; >> } >> =20 >> +sub update_crs_option { >> + my ($self, $name, $option_ref, $value, $default) =3D @_; >> + >> + my $haenv =3D $self->{haenv}; >> + >> + my $old_value =3D $$option_ref; >> + my $new_value =3D $value // $default; >> + >> + if (!defined($old_value)) { >> + $haenv->log('info', "using $name '$new_value'") if $new_value n= e $default; >> + } elsif ($old_value ne $new_value) { >> + $haenv->log('info', "switching $name from '$old_value' to '$new= _value'"); >> + } >> + >> + $$option_ref =3D $new_value; >> + >> + return; >> +} >> + >> sub update_crs_settings { >> my ($self) =3D @_; >> =20 >> @@ -106,6 +125,13 @@ sub update_crs_settings { >> my $dc_cfg =3D $haenv->get_datacenter_settings(); >> my $crs_cfg =3D $dc_cfg->{crs} // {}; >> =20 >> + $self->update_crs_option( >> + 'scheduler mode', >> + \$self->{crs}->{scheduler}, >> + $crs_cfg->{ha} || 'basic', > > nit: the `|| 'basic'` shouldn't be needed here, no? > good catch, thx the helper already falls back to the default, will drop in v3 >> + 'basic', >> + ); >> + [snip]