Skip to content

Commit 3692c11

Browse files
SuperSandro2000astro
authored andcommitted
Allow to configure virtofsd's --thread-pool-size
1 parent a2dbaa2 commit 3692c11

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

nixos-modules/host/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ in
281281
--socket-group=${config.users.users.microvm.group} \
282282
--shared-dir "$SOURCE" \
283283
--rlimit-nofile ${toString serviceConfig.LimitNOFILE} \
284-
--thread-pool-size `nproc` \
284+
--thread-pool-size ${toString config.microvm.virtiofsd.threadPoolSize} \
285285
--posix-acl --xattr \
286286
${lib.optionalString (config.microvm.virtiofsd.inodeFileHandles != null)
287287
"--inode-file-handles=${config.microvm.virtiofsd.inodeFileHandles}"

nixos-modules/host/options.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@
170170
'';
171171
};
172172

173+
virtiofsd.threadPoolSize = mkOption {
174+
type = with types; oneOf [ str ints.unsigned ];
175+
default = "`nproc`";
176+
description = ''
177+
The amounts of threads virtiofsd should spawn. This option also takes the special
178+
string `\`nproc\`` which spawns as many threads as the host has cores.
179+
'';
180+
};
181+
173182
virtiofsd.extraArgs = mkOption {
174183
type = with types; listOf str;
175184
default = [];

0 commit comments

Comments
 (0)