From 3692c11ceed00632345b106b24a8cd2c9ffe5569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 28 Jun 2024 00:01:47 +0200 Subject: [PATCH] Allow to configure virtofsd's --thread-pool-size --- nixos-modules/host/default.nix | 2 +- nixos-modules/host/options.nix | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos-modules/host/default.nix b/nixos-modules/host/default.nix index b6f61ce..b15dc1b 100644 --- a/nixos-modules/host/default.nix +++ b/nixos-modules/host/default.nix @@ -281,7 +281,7 @@ in --socket-group=${config.users.users.microvm.group} \ --shared-dir "$SOURCE" \ --rlimit-nofile ${toString serviceConfig.LimitNOFILE} \ - --thread-pool-size `nproc` \ + --thread-pool-size ${toString config.microvm.virtiofsd.threadPoolSize} \ --posix-acl --xattr \ ${lib.optionalString (config.microvm.virtiofsd.inodeFileHandles != null) "--inode-file-handles=${config.microvm.virtiofsd.inodeFileHandles}" diff --git a/nixos-modules/host/options.nix b/nixos-modules/host/options.nix index c3747ec..d9d4dd7 100644 --- a/nixos-modules/host/options.nix +++ b/nixos-modules/host/options.nix @@ -170,6 +170,15 @@ ''; }; + virtiofsd.threadPoolSize = mkOption { + type = with types; oneOf [ str ints.unsigned ]; + default = "`nproc`"; + description = '' + The amounts of threads virtiofsd should spawn. This option also takes the special + string `\`nproc\`` which spawns as many threads as the host has cores. + ''; + }; + virtiofsd.extraArgs = mkOption { type = with types; listOf str; default = [];