]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
qemu: do not enable kvm when booting on non-native arch
authorLuca Boccassi <bluca@debian.org>
Mon, 7 Aug 2023 01:29:52 +0000 (02:29 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 7 Aug 2023 10:16:34 +0000 (12:16 +0200)
kvm is only supported on the native architecture, so skip it
when booting a non-native one (eg: aarch64 on x86_64)

mkosi/qemu.py

index 1bae0e606a1255b66c436e64b48624bb12516a92..eafe610ad31c29541d78ac3d288bd22d0e707b13 100644 (file)
@@ -207,7 +207,7 @@ def copy_ephemeral(config: MkosiConfig, src: Path) -> Iterator[Path]:
 
 def run_qemu(args: MkosiArgs, config: MkosiConfig) -> None:
     accel = "tcg"
-    if config.qemu_kvm == ConfigFeature.enabled or (config.qemu_kvm == ConfigFeature.auto and qemu_check_kvm_support()):
+    if config.qemu_kvm == ConfigFeature.enabled or (config.qemu_kvm == ConfigFeature.auto and config.architecture.is_native() and qemu_check_kvm_support()):
         accel = "kvm"
 
     firmware, fw_supports_sb = find_qemu_firmware(config)