mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
qemu module: add virtualisation.cores option
QEMU can allow guests to access more than one host core at a time. Previously, this had to be done via ad-hoc arguments: virtualisation.qemu.options = ["-smp 12"]; Now you can simply specify: virtualisation.cores = 12;
This commit is contained in:
parent
91ad6b3597
commit
4585fdb9d4
@ -75,6 +75,7 @@ let
|
||||
exec ${qemu}/bin/qemu-kvm \
|
||||
-name ${vmName} \
|
||||
-m ${toString config.virtualisation.memorySize} \
|
||||
-smp ${toString config.virtualisation.cores} \
|
||||
${optionalString (pkgs.stdenv.system == "x86_64-linux") "-cpu kvm64"} \
|
||||
${concatStringsSep " " config.virtualisation.qemu.networkingOptions} \
|
||||
-virtfs local,path=/nix/store,security_model=none,mount_tag=store \
|
||||
@ -244,6 +245,18 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
virtualisation.cores =
|
||||
mkOption {
|
||||
default = 1;
|
||||
type = types.int;
|
||||
description =
|
||||
''
|
||||
Specify the number of cores the guest is permitted to use.
|
||||
The number can be higher than the available cores on the
|
||||
host system.
|
||||
'';
|
||||
};
|
||||
|
||||
virtualisation.pathsInNixDB =
|
||||
mkOption {
|
||||
default = [];
|
||||
|
Loading…
Reference in New Issue
Block a user