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 D60721FF13E for ; Fri, 06 Feb 2026 08:25:52 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 019D21FB9F; Fri, 6 Feb 2026 08:26:25 +0100 (CET) Message-ID: <4dffdb37-c01d-45eb-8053-4ec54e847390@proxmox.com> Date: Fri, 6 Feb 2026 08:26:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH manager v2 01/17] api/pvestatd: broadcast and expose non-x86 host architecture To: Thomas Lamprecht , pve-devel@lists.proxmox.com References: <20260203102118.1430545-1-d.csapak@proxmox.com> <20260203102118.1430545-2-d.csapak@proxmox.com> <4ddfce08-13c5-4d1e-9dc0-fd74d6c22cb5@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <4ddfce08-13c5-4d1e-9dc0-fd74d6c22cb5@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1770362702194 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.031 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 Message-ID-Hash: PVKMXVHRW2LJWAR3QFACUKYSKZS74EE6 X-Message-ID-Hash: PVKMXVHRW2LJWAR3QFACUKYSKZS74EE6 X-MailFrom: d.csapak@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 2/3/26 4:05 PM, Thomas Lamprecht wrote: > Am 03.02.26 um 11:20 schrieb Dominik Csapak: > >> diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm >> index 98d421f4..05f4061e 100755 >> --- a/PVE/Service/pvestatd.pm >> +++ b/PVE/Service/pvestatd.pm >> @@ -7,6 +7,7 @@ use PVE::SafeSyslog; >> use PVE::Daemon; >> >> use JSON; >> +use POSIX qw(); >> >> use Time::HiRes qw (gettimeofday); >> use PVE::Tools qw(dir_glob_foreach file_read_firstline); >> @@ -138,6 +139,8 @@ my sub broadcast_static_node_info { >> my $cgroup_mode = eval { PVE::CGroup::cgroup_mode(); }; >> syslog('err', "cgroup mode error: $@") if $@; >> >> + my (undef, undef, undef, undef, $architecture) = POSIX::uname(); > Besides reusing the helper from PVE::Tools I'd also prefer naming the variable > then `$host_arch`, as arch is a pretty standard abbreviation already and denoting > that this holds the host architecture itself is slightly nicer for a system where > there are also guest archs. do you also mean that i change the api property from 'architecture' ? (this seems a bit implied from the code snippet below, but I wanted to clarify before sending a wrong v3) > >> + >> my $old = PVE::Cluster::get_node_kv('static-info', $nodename); >> $old = eval { decode_json($old->{$nodename}) } if defined($old->{$nodename}); >> >> @@ -147,11 +150,18 @@ my sub broadcast_static_node_info { >> || !defined($old->{memory}) >> || $old->{memory} != $memory >> || ($old->{'cgroup-mode'} // -1) != ($cgroup_mode // -1) >> + || (defined($architecture) >> + && $architecture ne 'x86_64' >> + && (!defined($old->{architecture}) || $old->{architecture} ne $architecture)) >> ) { >> my $info = { >> cpus => $cpus, >> memory => $memory, >> }; >> + >> + # only save architecture info for non-x86 ones >> + $info->{architecture} = $architecture; > that isn't only saved for non-x86 though? If any other of the OR'd sub-expression > of the if here evaluates true, which will always happen sooner or later, we will > always set this. I.e., parts of the check above can move down here to make this > something like: > > $info->{'host-arch'} = $host_arch if defined($host_arch) && $host_arch ne 'x86_64'; yeah of course, i tried to model the if clause to already do that, but forgot that that triggers for all other things too on x86... sorry for that > > >> + >> $info->{'cgroup-mode'} = $cgroup_mode if defined($cgroup_mode); >> PVE::Cluster::broadcast_node_kv('static-info', encode_json($info)); >> } >