[pve-devel] [PATCH ha-manager 5/7] sim: hardware: do not print stat changes in set_static_service_stats

Daniel Kral d.kral at proxmox.com
Mon Nov 17 18:21:04 CET 2025


Using the command is already enough to document the changes and printing
to stdout will not document these changes anyway. Also will throw a
uninitialized value comparison warning for new HA resources, which do
not have any static service stat value set.

Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
 src/PVE/HA/Sim/Hardware.pm | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index a1381b78..baee2018 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -187,12 +187,10 @@ sub set_static_service_stats {
     my $stats = $self->read_static_service_stats();
 
     if (my $memory = $new_stats->{maxmem}) {
-        print "setting $sid memory to $memory\n" if $memory != $stats->{$sid}->{maxmem};
         $stats->{$sid}->{maxmem} = $memory;
     }
 
     if (my $cpu = $new_stats->{maxcpu}) {
-        print "setting $sid memory to $cpu\n" if $cpu != $stats->{$sid}->{maxcpu};
         $stats->{$sid}->{maxcpu} = $cpu;
     }
 
-- 
2.47.3





More information about the pve-devel mailing list