On Mon Feb 23, 2026 at 4:39 PM CET, Markus Frank wrote:
> Allows tuning the number of worker threads used by virtiofsd.
>
> Signed-off-by: Markus Frank <[email protected]>
> ---
> src/PVE/QemuServer/Virtiofs.pm | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/PVE/QemuServer/Virtiofs.pm b/src/PVE/QemuServer/Virtiofs.pm
> index b181db5f..cd95470d 100644
> --- a/src/PVE/QemuServer/Virtiofs.pm
> +++ b/src/PVE/QemuServer/Virtiofs.pm
> @@ -60,6 +60,14 @@ my $virtiofs_fmt = {
> default => 0,
> optional => 1,
> },
> + 'thread-pool-size' => {
> + type => 'integer',
> + description => "Controls the maximum number of worker threads used
> by virtiofsd to"
> + . " handle requests. A value of '0' disables the thread pool.",
> + default => 0,
> + minimum => 0,
> + optional => 1,
> + },
> };
> PVE::JSONSchema::register_format('pve-qm-virtiofs', $virtiofs_fmt);
>
> @@ -180,6 +188,8 @@ sub start_virtiofsd {
> my $cmd = [$virtiofsd_bin, "--fd=$fd", "--shared-dir=$path"];
> push @$cmd, '--xattr' if $virtiofs->{'expose-xattr'};
> push @$cmd, '--posix-acl' if $virtiofs->{'expose-acl'};
> + push @$cmd, '--thread-pool-size=' .
> $virtiofs->{'thread-pool-size'}
> + if $virtiofs->{'thread-pool-size'};
nit: this should be `if defined($virtiofs->{'thread-pool-size'})`,
otherwise it will not add `--thread-pool-size` at all. This still
works as expected because virtiofsd itself falls back to 0 though
[0].
[0]
https://gitlab.com/virtio-fs/virtiofsd/-/blob/89a24d1eb57d20b497c53a11cbf60a79b5655de4/src/main.rs#L156
> push @$cmd, '--announce-submounts';
> push @$cmd, '--allow-direct-io' if $virtiofs->{'direct-io'};
> push @$cmd, '--cache=' . $virtiofs->{cache} if
> $virtiofs->{cache};