Skip to content

Commit f6e7494

Browse files
authored
Merge pull request #406 from vunnyso/vs-qemuKvm
1 parent 2ba6697 commit f6e7494

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/runners/qemu.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,16 @@ let
3838
lib.optional requireUsb enableLibusb
3939
++ lib.optional microvmConfig.optimize.enable minimizeQemuClosureSize
4040
);
41+
qemuPkg =
42+
if microvmConfig.cpu == null && vmHostPackages.stdenv.hostPlatform.isLinux
43+
then
44+
# If no CPU is requested and the host is Linux, use qemu with KVM support (hardware-accelerated)
45+
vmHostPackages.qemu_kvm
46+
else
47+
# Different CPU architectures like darwin or Non-Linux use the generic qemu package
48+
vmHostPackages.qemu;
4149

42-
qemu = overrideQemu vmHostPackages.qemu;
50+
qemu = overrideQemu qemuPkg;
4351

4452
aioEngine = if vmHostPackages.stdenv.hostPlatform.isLinux
4553
then "io_uring"

0 commit comments

Comments
 (0)