diff options
author | Peter Hoeg <peter@hoeg.com> | 2018-09-28 22:27:52 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2018-09-28 22:28:26 +0800 |
commit | 6e3e136f77b3103a0c3b3fe7578c5864932b649c (patch) | |
tree | 88e989720cf09edbbb408285f88021438cc3dd5c | |
parent | ca6d41ae654386562ef7f00ae268e6e9070a3f49 (diff) |
nixos on hyperv: hot-add CPU
-rw-r--r-- | nixos/modules/virtualisation/hyperv-guest.nix | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nixos/modules/virtualisation/hyperv-guest.nix b/nixos/modules/virtualisation/hyperv-guest.nix index d86cb9fe1ab96..0f1f052880c5f 100644 --- a/nixos/modules/virtualisation/hyperv-guest.nix +++ b/nixos/modules/virtualisation/hyperv-guest.nix @@ -40,12 +40,16 @@ in { security.rngd.enable = false; - # enable hotadding memory + # enable hotadding cpu/memory services.udev.packages = lib.singleton (pkgs.writeTextFile { - name = "hyperv-memory-hotadd-udev-rules"; - destination = "/etc/udev/rules.d/99-hyperv-memory-hotadd.rules"; + name = "hyperv-cpu-and-memory-hotadd-udev-rules"; + destination = "/etc/udev/rules.d/99-hyperv-cpu-and-memory-hotadd.rules"; text = '' - ACTION="add", SUBSYSTEM=="memory", ATTR{state}="online" + # Memory hotadd + SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory[0-9]*", TEST=="state", ATTR{state}="online" + + # CPU hotadd + SUBSYSTEM=="cpu", ACTION=="add", DEVPATH=="/devices/system/cpu/cpu[0-9]*", TEST=="online", ATTR{online}="1" ''; }); |