diff options
author | Andrea Bolognani <abologna@redhat.com> | 2017-12-11 15:32:49 +0100 |
---|---|---|
committer | Andrea Bolognani <abologna@redhat.com> | 2018-01-08 13:48:44 +0100 |
commit | 6512b0ddc1eb32807e0b453ce83d243ae5837193 (patch) | |
tree | e9593e01428003672d643363c81e6706af20c1fd /tests/virhostcpudata | |
parent | 5e07b28a7a385da96540a809acd8853d3876ebfd (diff) | |
download | libvirt-6512b0ddc1eb32807e0b453ce83d243ae5837193.tar.gz |
util: Improve CPU frequency parsing
Make the parser both more strict, by not ignoring errors reported
by virStrToLong_ui(), and more permissive, by not failing due to
unrelated fields which just happen to have a know prefix and
accepting any amount of whitespace before the numeric value.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Diffstat (limited to 'tests/virhostcpudata')
-rw-r--r-- | tests/virhostcpudata/linux-x86_64-test1.cpuinfo | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/virhostcpudata/linux-x86_64-test1.cpuinfo b/tests/virhostcpudata/linux-x86_64-test1.cpuinfo index e88a48ff35..706b69a543 100644 --- a/tests/virhostcpudata/linux-x86_64-test1.cpuinfo +++ b/tests/virhostcpudata/linux-x86_64-test1.cpuinfo @@ -28,6 +28,10 @@ model : 4 model name : Intel(R) Xeon(TM) CPU 2.80GHz stepping : 8 cpu MHz : 2800.000 +# The following field is a made-up one, intended to make sure our cpuinfo +# parser deals correctly with the introduction of new fields that just so +# happen to share a prefix with the one used for CPU frequency +cpu MHz rounded up to GHz : 3000.000 cache size : 2048 KB physical id : 0 siblings : 2 |