From: Mike Qiu <[email protected]>

Currently, the regular expression in extract_qemu_cpu_models is just
able to work with X86 qemu.

Add check if X86 pattern return none, will use PowerPC pattern to
get qemu support cpu model.

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

diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py
index b0b02f2..62ab839 100644
--- a/virttest/utils_misc.py
+++ b/virttest/utils_misc.py
@@ -1189,7 +1189,12 @@ def extract_qemu_cpu_models(qemu_cpu_help_text):
     @return: list of cpu models
     """
     cpu_re = re.compile("x86\s+\[?([a-zA-Z0-9_-]+)\]?.*\n")
-    return cpu_re.findall(qemu_cpu_help_text)
+    qemu_cpu_model_list = cpu_re.findall(qemu_cpu_help_text)
+    if not qemu_cpu_model_list:
+        cpu_re = re.compile("PowerPC\s+\[?([a-zA-Z0-9_-]+\.?[0-9]?)\]?.*\n")
+        qemu_cpu_model_list = cpu_re.findall(qemu_cpu_help_text)
+
+    return qemu_cpu_model_list
 
 
 def get_qemu_cpu_models(qemu_binary):
-- 
1.7.7.6

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

Reply via email to