From: Dietmar Maurer Date: Mon, 26 Mar 2012 05:54:29 +0000 (+0200) Subject: return number of sockets in read_cpuinfo X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=66bda4e09d2d7de880b1fda8b54c72bd68adf555;ds=sidebyside return number of sockets in read_cpuinfo --- diff --git a/Makefile b/Makefile index b244fa5..dd457b3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ RELEASE=2.0 VERSION=1.0 -PKGREL=21 +PKGREL=22 PACKAGE=libpve-common-perl diff --git a/data/PVE/ProcFSTools.pm b/data/PVE/ProcFSTools.pm index 723fd42..bdb6e52 100644 --- a/data/PVE/ProcFSTools.pm +++ b/data/PVE/ProcFSTools.pm @@ -20,6 +20,7 @@ sub read_cpuinfo { model => 'unknown', mhz => 0, cpus => 1, + sockets => 1, }; my $fh = IO::File->new ($fn, "r"); @@ -35,7 +36,11 @@ sub read_cpuinfo { $res->{mhz} = $1 if !$res->{mhz}; } elsif ($line =~ m/^flags\s*:.*(vmx|svm)/) { $res->{hvm} = 1; # Hardware Virtual Machine (Intel VT / AMD-V) + } elsif ($line =~ m/^physical id\s*:\s*(\d+)\s*$/i) { + my $sid = $1 + 1; + $res->{sockets} = $sid if $sid > $res->{sockets}; } + } $res->{cpus} = $count; diff --git a/debian/changelog b/debian/changelog index 3844561..85277a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libpve-common-perl (1.0-22) unstable; urgency=low + + * return number of sockets in read_cpuinfo + + -- Proxmox Support Team Mon, 26 Mar 2012 07:53:35 +0200 + libpve-common-perl (1.0-21) unstable; urgency=low * use Digest::SHA instead of Digest::SHA1