nixos/lib/qemu-common: Opportunistically use KVM

This will try to use KVM if available and fallback to using TCG if not.
Useful for nested virtualisation of arm on x86.
main
Max Hausch 2 years ago
parent 1a069f4e72
commit a2465483e8
No known key found for this signature in database
GPG Key ID: C19929CA092DD618
  1. 4
      nixos/lib/qemu-common.nix

@ -23,8 +23,8 @@ rec {
qemuBinary = qemuPkg: {
x86_64-linux = "${qemuPkg}/bin/qemu-kvm -cpu max";
armv7l-linux = "${qemuPkg}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host";
aarch64-linux = "${qemuPkg}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host";
armv7l-linux = "${qemuPkg}/bin/qemu-system-arm -machine virt,accel=kvm:tcg -cpu max";
aarch64-linux = "${qemuPkg}/bin/qemu-system-aarch64 -machine virt,gic-version=max,accel=kvm:tcg -cpu max";
powerpc64le-linux = "${qemuPkg}/bin/qemu-system-ppc64 -machine powernv";
powerpc64-linux = "${qemuPkg}/bin/qemu-system-ppc64 -machine powernv";
x86_64-darwin = "${qemuPkg}/bin/qemu-kvm -cpu max";

Loading…
Cancel
Save