summaryrefslogtreecommitdiffstats
path: root/scripts/kvm/kvm_stat
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kvm/kvm_stat')
-rwxr-xr-xscripts/kvm/kvm_stat29
1 files changed, 13 insertions, 16 deletions
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index 93b5ea7aac..5b6742a6b7 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -254,24 +254,21 @@ def aarch64_init():
EXIT_REASONS = AARCH64_EXIT_REASONS
def detect_platform():
- if os.uname()[4].startswith('ppc'):
+ machine = os.uname()[4]
+
+ if machine.startswith('ppc'):
ppc_init()
- return
- elif os.uname()[4].startswith('aarch64'):
+ elif machine.startswith('aarch64'):
aarch64_init()
- return
-
- for line in file('/proc/cpuinfo').readlines():
- if line.startswith('flags'):
- for flag in line.split():
- if flag in X86_EXIT_REASONS:
- x86_init(flag)
- return
- elif line.startswith('vendor_id'):
- for flag in line.split():
- if flag == 'IBM/S390':
- s390_init()
- return
+ elif machine.startswith('s390'):
+ s390_init()
+ else:
+ for line in file('/proc/cpuinfo').readlines():
+ if line.startswith('flags'):
+ for flag in line.split():
+ if flag in X86_EXIT_REASONS:
+ x86_init(flag)
+ return
def walkdir(path):