Skip to content

Commit e785d7c

Browse files
GabrielMajerinicholasbishop
authored andcommitted
Add flag to build.py for disabling KVM
1 parent 8aeac23 commit e785d7c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

uefi-test-runner/build.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
'config': 'debug',
2929
# Disables some tests which don't work in our CI setup
3030
'ci': False,
31+
# KVM is a Linux kernel module which allows QEMU to use
32+
# hardware-accelerated virtualization.
33+
'disable_kvm': False,
3134
# QEMU executable to use
3235
# Indexed by the `arch` setting
3336
'qemu_binary': {
@@ -247,8 +250,9 @@ def run_qemu():
247250
'-m', '256M',
248251
])
249252
if not SETTINGS['ci']:
250-
# Enable acceleration if possible.
251-
qemu_flags.append('--enable-kvm')
253+
# Enable hardware-accelerated virtualization if possible.
254+
if not SETTINGS['disable_kvm']:
255+
qemu_flags.append('--enable-kvm')
252256
else:
253257
# Exit instead of rebooting
254258
qemu_flags.append('-no-reboot')
@@ -407,6 +411,9 @@ def main():
407411
parser.add_argument('--ci', help='disables some tests which currently break CI',
408412
action='store_true')
409413

414+
parser.add_argument('--disable-kvm', help='disables hardware accelerated virtualization support in QEMU',
415+
action='store_true')
416+
410417
opts = parser.parse_args()
411418

412419
SETTINGS['arch'] = opts.target
@@ -415,6 +422,7 @@ def main():
415422
SETTINGS['headless'] = opts.headless
416423
SETTINGS['config'] = 'release' if opts.release else 'debug'
417424
SETTINGS['ci'] = opts.ci
425+
SETTINGS['disable_kvm'] = opts.disable_kvm
418426

419427
verb = opts.verb
420428

0 commit comments

Comments
 (0)