aboutsummaryrefslogtreecommitdiff
path: root/nixos/lib/qemu-flags.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-08-21 23:33:59 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2020-08-21 23:42:07 -0500
commit47b56e7c19c2e3af685ee408f02f232efb3d12b1 (patch)
treec4577e5c11903ca4805d54fba6d45124193e726e /nixos/lib/qemu-flags.nix
parente5a097a8cdeb731d2a2ecf300a0e0609d8d5677b (diff)
runInLinuxVM, test-driver: use -cpu max instead of -cpu host
This appears to avoid requiring KVM when it’s not available. This is what I originally though -cpu host did. Unfortunately not much documentation available from the QEMU side on this, but this appears to square with help: $ qemu-system-x86 -cpu help ... x86 host KVM processor with all supported host features x86 max Enables all features supported by the accelerator in the current host ... Whether we actually want to support this not clear, since this only happens when your CPU doesn’t have full KVM support. Some Nix builders are lying about kvm support though. Things aren’t too slow without it though. Fixes https://github.com/NixOS/nixpkgs/issues/85394 Alternative to https://github.com/NixOS/nixpkgs/pull/83920
Diffstat (limited to 'nixos/lib/qemu-flags.nix')
-rw-r--r--nixos/lib/qemu-flags.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/lib/qemu-flags.nix b/nixos/lib/qemu-flags.nix
index 0cf6977af4bb..0f0662458935 100644
--- a/nixos/lib/qemu-flags.nix
+++ b/nixos/lib/qemu-flags.nix
@@ -22,9 +22,9 @@ rec {
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";
qemuBinary = qemuPkg: {
- x86_64-linux = "${qemuPkg}/bin/qemu-kvm -cpu host";
+ 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";
- x86_64-darwin = "${qemuPkg}/bin/qemu-kvm -cpu host";
+ x86_64-darwin = "${qemuPkg}/bin/qemu-kvm -cpu max";
}.${pkgs.stdenv.hostPlatform.system} or "${qemuPkg}/bin/qemu-kvm";
}