From: Mike Qiu <[email protected]>

Currently, autotest support amd and intel's X86 cpu type, IBM Power
cpus will be configure as 'unknown'.

Add pattern to deal with the cpuinfo of power, so that can figure
out the vendor IBM.

Signed-off-by: Mike Qiu <[email protected]>
---
 virttest/utils_misc.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py
index 2eba264..f1904dc 100644
--- a/virttest/utils_misc.py
+++ b/virttest/utils_misc.py
@@ -556,11 +556,14 @@ def get_cpu_flags():
     """
     Returns a list of the CPU flags
     """
-    flags_re = re.compile(r'^flags\s*:(.*)')
+    flags_re = re.compile(r'^flags\s*:(.*)|^cpu\s*:(.*)')
     for line in open('/proc/cpuinfo').readlines():
         match = flags_re.match(line)
         if match:
-            return match.groups()[0].split()
+            if match.groups()[0]:
+                 return match.groups()[0].split()
+            else:
+                 return match.groups()[1].strip().split(', ')
     return []
 
 
@@ -575,6 +578,8 @@ def get_cpu_vendor(cpu_flags=[], verbose=True):
         vendor = 'intel'
     elif 'svm' in cpu_flags:
         vendor = 'amd'
+    elif 'POWER' in cpu_flags:
+        vendor = 'IBM'
     else:
         vendor = 'unknown'
 
-- 
1.7.7.6

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to