on power system, kvm only have kvm.ko module. this patch adjects
load_kvm and unload_kvm functions when finding the cpu is power7

Signed-off-by: Liu Sheng <liush...@linux.vnet.ibm.com>
---
 client/kvm_control.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/client/kvm_control.py b/client/kvm_control.py
index 1acef55..8247d50 100644
--- a/client/kvm_control.py
+++ b/client/kvm_control.py
@@ -18,12 +18,15 @@ def get_kvm_arch():
                 arch_type = "kvm_amd"
             elif "GenuineIntel" in line:
                 arch_type = "kvm_intel"
+            elif "POWER7" in line:
+                arch_type = "kvm_power7"
+                return arch_type
         elif "flags" in line:
             if arch_type == "kvm_amd" and "svm" in line:
                 return arch_type
             if arch_type == "kvm_intel" and "vmx" in line:
                 return arch_type
-    raise error.TestError("CPU Must be AMD or Intel, and must be KVM ready.")
+    raise error.TestError("CPU Must be AMD or Intel or POWER7, and must be KVM 
ready.")
 
 
 def load_kvm():
@@ -31,6 +34,8 @@ def load_kvm():
     Loads the appropriate KVM kernel modules
     """
     kvm_status = utils.system('modprobe kvm')
+    if arch_type == "kvm_power7":
+        return kvm_status
     kvm_amdintel_status = utils.system("modprobe " + kvm_arch)
     if kvm_status:
         return kvm_status
@@ -41,6 +46,9 @@ def unload_kvm():
     """
     Unloads the appropriate KVM kernel modules
     """
+    if arch_type == "kvm_power7":
+        kvm_status = utils.system('rmmod kvm')
+        return kvm_status
     kvm_amdintel_status = utils.system("rmmod " + kvm_arch)
     kvm_status = utils.system('rmmod kvm')
     if kvm_status:
-- 
1.7.7.6

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to