提交 1bc28c28 编写于 作者: V Viktor Mihajlovski 提交者: Cole Robinson

S390: Buffer too small for large CPU numbers.

The output buffer for virFileReadAll was too small for systems with
more than 30 CPUs which leads to a log entry and incorrect behavior.
The new size will be sufficient for the current
architectural limits.
Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
(cherry picked from commit 4bdc8606)
上级 6730e635
...@@ -361,7 +361,7 @@ virSysinfoRead(void) { ...@@ -361,7 +361,7 @@ virSysinfoRead(void) {
goto no_memory; goto no_memory;
/* Gather info from /proc/cpuinfo */ /* Gather info from /proc/cpuinfo */
if (virFileReadAll(CPUINFO, 2048, &outbuf) < 0) { if (virFileReadAll(CPUINFO, 8192, &outbuf) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to open %s"), CPUINFO); _("Failed to open %s"), CPUINFO);
return NULL; return NULL;
...@@ -376,7 +376,7 @@ virSysinfoRead(void) { ...@@ -376,7 +376,7 @@ virSysinfoRead(void) {
VIR_FREE(outbuf); VIR_FREE(outbuf);
/* Gather info from /proc/sysinfo */ /* Gather info from /proc/sysinfo */
if (virFileReadAll(SYSINFO, 4096, &outbuf) < 0) { if (virFileReadAll(SYSINFO, 8192, &outbuf) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to open %s"), SYSINFO); _("Failed to open %s"), SYSINFO);
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册