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.
> +
> 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';
> +
> $info->{'cgroup-mode'} = $cgroup_mode if defined($cgroup_mode);
> PVE::Cluster::broadcast_node_kv('static-info', encode_json($info));
> }