summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2021-10-22 17:27:03 +0200
committerJanne Heß <janne@hess.ooo>2021-11-18 21:21:49 +0100
commitecf388e90b68e1437e124a02a4a7c44f71eaf342 (patch)
tree349cff3bd455ff97499533563cda9c0ee312b082
parentd5321ca4ad2d56070c52c98c7b8da82d55eba0fc (diff)
downloadnixpkgs-ecf388e90b68e1437e124a02a4a7c44f71eaf342.tar
nixpkgs-ecf388e90b68e1437e124a02a4a7c44f71eaf342.tar.gz
nixpkgs-ecf388e90b68e1437e124a02a4a7c44f71eaf342.tar.bz2
nixpkgs-ecf388e90b68e1437e124a02a4a7c44f71eaf342.tar.lz
nixpkgs-ecf388e90b68e1437e124a02a4a7c44f71eaf342.tar.xz
nixpkgs-ecf388e90b68e1437e124a02a4a7c44f71eaf342.tar.zst
nixpkgs-ecf388e90b68e1437e124a02a4a7c44f71eaf342.zip
vmTools: Make msize larger to silence warning
See https://issues.guix.gnu.org/47225
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix2
-rw-r--r--pkgs/build-support/vm/default.nix9
2 files changed, 8 insertions, 3 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 6ce4461babc..67fde55faab 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -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
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index a6633d11286..a0f3b5efbae 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -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;
 }