summaryrefslogtreecommitdiff
path: root/tests/virhostcpudata
diff options
context:
space:
mode:
authorAndrea Bolognani <abologna@redhat.com>2017-12-11 15:32:49 +0100
committerAndrea Bolognani <abologna@redhat.com>2018-01-08 13:48:44 +0100
commit6512b0ddc1eb32807e0b453ce83d243ae5837193 (patch)
treee9593e01428003672d643363c81e6706af20c1fd /tests/virhostcpudata
parent5e07b28a7a385da96540a809acd8853d3876ebfd (diff)
downloadlibvirt-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.cpuinfo4
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