From ccfff9204ef1241ab43e9a03bef21e39bac24547 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 28 Oct 2016 17:50:13 +0200 Subject: [PATCH] use new CpuSet::max_cpuid() helper --- PVE/Service/pvestatd.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 44ad020d..37748334 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pvestatd.pm @@ -229,8 +229,9 @@ sub rebalance_lxc_containers { my $all_cpus = PVE::CpuSet->new_from_cgroup('lxc', 'effective_cpus'); my @allowed_cpus = $all_cpus->members(); my $cpucount = scalar(@allowed_cpus); + my $max_cpuid = PVE::CpuSet::max_cpuid(); - my @cpu_ctcount = (0) x $PVE::CpuSet::MAX_CPUID; + my @cpu_ctcount = (0) x $max_cpuid; my @balanced_cts; my $ctlist = PVE::LXC::config_list(); @@ -288,7 +289,7 @@ sub rebalance_lxc_containers { } foreach my $cpu (@cpuset_members) { - $cpu_ctcount[$cpu]++ if $cpu <= $PVE::CpuSet::MAX_CPUID; + $cpu_ctcount[$cpu]++ if $cpu <= $max_cpuid; } }