提交 a76530c9 编写于 作者: P Prerna Saxena 提交者: Eric Blake

On systems with dmidecode version 2.10 or older,

 dmidecode displays processor information, followed by BIOS, system and
 memory-DIMM details.
 Calls to virSysinfoParseBIOS(), virSysinfoParseSystem() would update
 the buffer pointer 'base', so the processor information would be lost
 before virSysinfoParseProcessor() was called. Sysinfo would therefore
 not be able to display processor details -- It only described <bios>,
 <system> and <memory_device> details.
 This patch attempts to insulate sysinfo from ordering of dmidecode
 output.

Before the fix:
---------------
virsh # sysinfo
<sysinfo type='smbios'>
  <bios>
    ....
  </bios>
  <system>
    ....
  </system>
  <memory_device>
    ....
  </memory_device>

After the fix:
-------------
virsh # sysinfo
<sysinfo type='smbios'>
  <bios>
    ....
  </bios>
  <system>
    ....
  </system>
  <processor>
    ....
  </processor>
  <memory_device>
    ....
  </memory_device>
上级 0ed86cfb
......@@ -453,7 +453,7 @@ no_memory:
virSysinfoDefPtr
virSysinfoRead(void) {
char *path, *base;
char *path;
virSysinfoDefPtr ret = NULL;
char *outbuf = NULL;
virCommandPtr cmd;
......@@ -481,22 +481,20 @@ virSysinfoRead(void) {
ret->type = VIR_SYSINFO_SMBIOS;
base = outbuf;
if ((base = virSysinfoParseBIOS(base, ret)) == NULL)
if ((virSysinfoParseBIOS(outbuf, ret)) == NULL)
goto no_memory;
if ((base = virSysinfoParseSystem(base, ret)) == NULL)
if ((virSysinfoParseSystem(outbuf, ret)) == NULL)
goto no_memory;
ret->nprocessor = 0;
ret->processor = NULL;
if ((base = virSysinfoParseProcessor(base, ret)) == NULL)
if ((virSysinfoParseProcessor(outbuf, ret)) == NULL)
goto no_memory;
ret->nmemory = 0;
ret->memory = NULL;
if (virSysinfoParseMemory(base, ret) == NULL)
if (virSysinfoParseMemory(outbuf, ret) == NULL)
goto no_memory;
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册