Merge pull request #142577 from helsinki-systems/feat/larger-p9-msize

vmTools: Make msize larger to silence warning
This commit is contained in:
Kim Lindberger 2021-11-19 00:49:26 +01:00 committed by GitHub
commit 76f5b6bb9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -306,7 +306,7 @@ in
virtualisation.msize =
mkOption {
type = types.ints.positive;
default = 16384;
default = pkgs.vmTools.default9PMsizeBytes;
description =
''
The msize (maximum packet size) option passed to 9p file systems, in

View file

@ -110,7 +110,7 @@ rec {
echo "mounting Nix store..."
mkdir -p /fs${storeDir}
mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose
mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose,msize=${toString default9PMsizeBytes}
mkdir -p /fs/tmp /fs/run /fs/var
mount -t tmpfs -o "mode=1777" none /fs/tmp
@ -119,7 +119,7 @@ rec {
echo "mounting host's temporary directory..."
mkdir -p /fs/tmp/xchg
mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L
mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L,msize=${toString default9PMsizeBytes}
mkdir -p /fs/proc
mount -t proc none /fs/proc
@ -1174,4 +1174,9 @@ rec {
`debDistros' sets. */
diskImages = lib.mapAttrs (name: f: f {}) diskImageFuns;
# The default 9P msize value is 8 KiB, which according to QEMU is
# insufficient and would degrade performance.
# See: https://wiki.qemu.org/Documentation/9psetup#msize
# Use 500 KiB as a conservative default, see also https://github.com/NixOS/nixpkgs/pull/142577#issuecomment-953848731
default9PMsizeBytes = 512000;
}