]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
sysinfo: Fix reports on ARM
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 12 May 2015 16:21:18 +0000 (18:21 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 May 2015 16:13:18 +0000 (18:13 +0200)
commit85128e296232c0b95b18321b76a15252b0db5a90
tree32935d271f25a564d9a426e9895ccfc194f9fd4f
parent04695f48b2440292d63210c012727584c65fe75f
sysinfo: Fix reports on ARM

Due to a kernel commit (b4b8f770e), cpuinfo format has changed on
ARMs. Firstly, 'Processor: ...' may not be reported, it's
replaced by 'model name: ...'. Secondly, the "Processor" string
may occur in CPU name, e.g. 'ARMv7 Processor rev 5 (v7l)'.
Therefore, we must firstly look for 'model name' and then for
'Processor' if not found.
Moreover, lines in the cpuinfo file are shuffled, so we better
not manipulate the pointer to start of internal buffer as we may
lost some info.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virsysinfo.c
tests/sysinfodata/arm-rpi2cpuinfo.data [new file with mode: 0644]
tests/sysinfodata/arm-rpi2sysinfo.expect [new file with mode: 0644]
tests/sysinfotest.c