Skip to content

Commit

Permalink
Merge pull request NixOS#111462 from jakobrs/msize
Browse files Browse the repository at this point in the history
nixos/qemu-vm: add virtualisation.msize option
  • Loading branch information
worldofpeace authored Feb 26, 2021
2 parents c349371 + 278843e commit 1546bea
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions nixos/modules/virtualisation/qemu-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,18 @@ in
'';
};

virtualisation.msize =
mkOption {
default = null;
type = types.nullOr types.ints.unsigned;
description =
''
msize (maximum packet size) option passed to 9p file systems, in
bytes. Increasing this should increase performance significantly,
at the cost of higher RAM usage.
'';
};

virtualisation.diskSize =
mkOption {
default = 512;
Expand Down Expand Up @@ -666,7 +678,7 @@ in
${if cfg.writableStore then "/nix/.ro-store" else "/nix/store"} =
{ device = "store";
fsType = "9p";
options = [ "trans=virtio" "version=9p2000.L" "cache=loose" ];
options = [ "trans=virtio" "version=9p2000.L" "cache=loose" ] ++ lib.optional (cfg.msize != null) "msize=${toString cfg.msize}";
neededForBoot = true;
};
"/tmp" = mkIf config.boot.tmpOnTmpfs
Expand All @@ -679,13 +691,13 @@ in
"/tmp/xchg" =
{ device = "xchg";
fsType = "9p";
options = [ "trans=virtio" "version=9p2000.L" ];
options = [ "trans=virtio" "version=9p2000.L" ] ++ lib.optional (cfg.msize != null) "msize=${toString cfg.msize}";
neededForBoot = true;
};
"/tmp/shared" =
{ device = "shared";
fsType = "9p";
options = [ "trans=virtio" "version=9p2000.L" ];
options = [ "trans=virtio" "version=9p2000.L" ] ++ lib.optional (cfg.msize != null) "msize=${toString cfg.msize}";
neededForBoot = true;
};
} // optionalAttrs (cfg.writableStore && cfg.writableStoreUseTmpfs)
Expand Down

0 comments on commit 1546bea

Please sign in to comment.