From: Mike Qiu <[email protected]> Currently, virt-tests support amd and intel's X86 cpu type, IBM Power cpus will be detected as 'unknown'.
To solve the problem, use platform.machine, so when the arch is ppc64, we can return appropriate power CPU models. Signed-off-by: Mike Qiu <[email protected]> --- virttest/utils_misc.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py index 7acfcd5..7502fe4 100644 --- a/virttest/utils_misc.py +++ b/virttest/utils_misc.py @@ -11,6 +11,10 @@ from autotest.client.shared import error, logging_config from autotest.client.shared import git import utils_koji, data_dir +import platform +ARCH = platform.machine() + + # TODO: remove this import when log_last_traceback is moved to autotest import traceback @@ -600,6 +604,8 @@ def get_cpu_vendor(cpu_flags=[], verbose=True): vendor = 'intel' elif 'svm' in cpu_flags: vendor = 'amd' + elif ARCH == 'ppc64': + vendor = 'ibm' else: vendor = 'unknown' @@ -1154,6 +1160,9 @@ def get_host_cpu_models(): pattern += r".+(\b%s\b)" % i return pattern + if ARCH == 'ppc64': + return 'POWER7' + vendor_re = "vendor_id\s+:\s+(\w+)" cpu_flags_re = "flags\s+:\s+([\w\s]+)\n" -- 1.8.2 _______________________________________________ Virt-test-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/virt-test-devel
