[libvirt] [PATCH v2] sysinfo: Fix reports on ARM

Ján Tomko jtomko at redhat.com
Thu May 21 15:03:33 UTC 2015


On Wed, May 13, 2015 at 01:55:43PM +0200, Michal Privoznik wrote:
> 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 at redhat.com>
> ---
> 
> diff to v1:
> - Jan's comments worked in
> - added new test case (yes, there really is a space at EOL in cpuinfo on my ARM)
> 
>  src/util/virsysinfo.c                    |  9 +++----
>  tests/sysinfodata/arm-rpi2cpuinfo.data   | 43 ++++++++++++++++++++++++++++++++
>  tests/sysinfodata/arm-rpi2sysinfo.expect | 18 +++++++++++++
>  tests/sysinfotest.c                      | 22 ++++++++++++----
>  4 files changed, 82 insertions(+), 10 deletions(-)
>  create mode 100644 tests/sysinfodata/arm-rpi2cpuinfo.data
>  create mode 100644 tests/sysinfodata/arm-rpi2sysinfo.expect
> 

ACK

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150521/2bd98815/attachment-0001.sig>


More information about the libvir-list mailing list