Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2b51328002dd
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 55e2c850a3f8
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on May 26, 2019

  1. nixos/kvmgt: fix starting condition

    gnidorah committed May 26, 2019
    Copy the full SHA
    eac62f6 View commit details

Commits on Jun 17, 2019

  1. nixos/kvmgt: fix starting condition (#62096)

    nixos/kvmgt: fix starting condition
    Mic92 authored Jun 17, 2019
    Copy the full SHA
    55e2c85 View commit details
Showing with 10 additions and 8 deletions.
  1. +10 −8 nixos/modules/virtualisation/kvmgt.nix
18 changes: 10 additions & 8 deletions nixos/modules/virtualisation/kvmgt.nix
Original file line number Diff line number Diff line change
@@ -46,22 +46,24 @@ in {
message = "KVMGT is not properly supported for kernels older than 4.16";
};
boot.kernelParams = [ "i915.enable_gvt=1" ];
systemd.paths = mapAttrs' (name: value:
nameValuePair "kvmgt-${name}" {
description = "KVMGT VGPU ${name} path";
wantedBy = [ "multi-user.target" ];
pathConfig = {
PathExists = "/sys/bus/pci/devices/${cfg.device}/mdev_supported_types/${name}/create";
};
}
) cfg.vgpus;
systemd.services = mapAttrs' (name: value:
nameValuePair "kvmgt-${name}" {
description = "KVMGT VGPU ${name}";
serviceConfig = {
Type = "forking";
Type = "oneshot";
RemainAfterExit = true;
Restart = "on-failure";
RestartSec = 5;
ExecStart = "${pkgs.runtimeShell} -c 'echo ${value.uuid} > /sys/bus/pci/devices/${cfg.device}/mdev_supported_types/${name}/create'";
ExecStop = "${pkgs.runtimeShell} -c 'echo 1 > /sys/bus/pci/devices/${cfg.device}/${value.uuid}/remove'";
};
unitConfig = {
StartLimitBurst = 5;
StartLimitIntervalSec = 30;
};
wantedBy = [ "multi-user.target" ];
}
) cfg.vgpus;
};