Skip to content

Commit c250949

Browse files
committed
qemu: Refactor KVM check
1 parent bb8b7fe commit c250949

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/qemu.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,12 @@ def get_host_cpu():
466466
if words[0] == 'cpu':
467467
return words[2]
468468

469+
def kvm_present():
470+
return os.path.exists('/sys/module/kvm_hv')
471+
469472

470473
def kvm_possible(machine, cpu):
471-
if machine == 'pseries' and os.path.exists('/sys/module/kvm_hv'):
474+
if kvm_present() and machine == 'pseries':
472475
host_cpu = get_host_cpu()
473476
if host_cpu == 'POWER8':
474477
supported = ['POWER8']

0 commit comments

Comments
 (0)