From: Mike Qiu <[email protected]> modify code to catch the word 'processor' rather than 'model name' in /proc/cpuinfo to count cpu number. Becasue the Power cpu haven't the 'model name', and both x86 and Power cpu has 'processor'
Signed-off-by: Mike Qiu <[email protected]> Signed-off-by: Liu Sheng <[email protected]> --- qemu/tests/cgroup.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/tests/cgroup.py b/qemu/tests/cgroup.py index c05877d..2f57255 100644 --- a/qemu/tests/cgroup.py +++ b/qemu/tests/cgroup.py @@ -587,7 +587,7 @@ def run_cgroup(test, params, env): raise error.TestFail("Can't mount cpu cgroup modules") cgroup = Cgroup('cpu', '') cgroup.initialize(modules) - host_cpus = open('/proc/cpuinfo').read().count('model name') + host_cpus = open('/proc/cpuinfo').read().count('processor') # Create first VM params['smp'] = 1 @@ -755,7 +755,7 @@ def run_cgroup(test, params, env): raise error.TestError("Incorrect configuration: param " "cgroup_speeds have to be list-like string '[1, 2]'") - host_cpus = open('/proc/cpuinfo').read().count('model name') + host_cpus = open('/proc/cpuinfo').read().count('processor') # when smp <= 0 use smp = no_host_cpus vm_cpus = int(params.get('smp', 0)) # cpus per VM # Use smp = no_host_cpu -- 1.7.7.6 _______________________________________________ Virt-test-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/virt-test-devel
