[libvirt] [PATCH v2] Buffer size too small when reading sysinfo

On a system with 160 CPUs the /proc/cpuinfo size grows beyond the currently set limit of 10KB causing an internal error. This patch increases the buffer size to 1MB. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/util/virsysinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 1bb6392..789c3bc 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -50,7 +50,7 @@ static const char *sysinfoCpuinfo = "/proc/cpuinfo"; #define SYSINFO_SMBIOS_DECODER sysinfoDmidecode #define SYSINFO sysinfoSysinfo #define CPUINFO sysinfoCpuinfo -#define CPUINFO_FILE_LEN (10*1024) /* 10KB limit for /proc/cpuinfo file */ +#define CPUINFO_FILE_LEN (1024*1024) /* 1MB limit for /proc/cpuinfo file */ /* only to be used test programs, therefore not in sysinfo.h */ extern void virSysinfoSetup(const char *dmidecode, const char *sysinfo, -- 1.9.3

On 12/17/2014 08:47 AM, Boris Fiuczynski wrote:
On a system with 160 CPUs the /proc/cpuinfo size grows beyond the currently set limit of 10KB causing an internal error.
This patch increases the buffer size to 1MB.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/util/virsysinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ACK and pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Boris Fiuczynski
-
Eric Blake