all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 qemu-server] virtiofs: prevent issue with Windows OS and too many files
@ 2025-05-02 14:21 Fiona Ebner
  2025-06-02  6:20 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2025-05-02 14:21 UTC (permalink / raw)
  To: pve-devel

As reported in the community forum [0] and the virtio-win project [1],
virtiofsd will run into its open file limit when used with a Windows
guest that reads too many files. It's also reported that the issue
does not occur with Linux guests and a workaround is using
'--inode-file-handles=mandatory' on virtiofsd command line.

The option is described as follows in the virtiofsd help:

> When to use file handles to reference inodes instead of O_PATH file
> descriptors (never, prefer, mandatory)

and the default is 'never'.

Fix the above issue by using 'prefer' rather than 'mandatory', because
that should not break other edge cases:

> prefer: Attempt to generate file handles, but fall back to O_PATH
> file descriptors where the underlying filesystem does not support
> file handles. Useful when there are various different filesystems
> under the shared directory and some of them do not support file
> handles.

[0]: https://forum.proxmox.com/threads/165565/
[1]: https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1136

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Markus Frank <m.frank@proxmox.com>
---

Changes in v2:
* fix typo in commit message
* add Markus's T-b trailer

 PVE/QemuServer/Virtiofs.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer/Virtiofs.pm b/PVE/QemuServer/Virtiofs.pm
index cfde92c9..5a91b23a 100644
--- a/PVE/QemuServer/Virtiofs.pm
+++ b/PVE/QemuServer/Virtiofs.pm
@@ -130,14 +130,17 @@ sub start_all_virtiofsd {
 	next if !$conf->{$opt};
 	my $virtiofs = parse_property_string('pve-qm-virtiofs', $conf->{$opt});
 
-	my $virtiofs_socket = start_virtiofsd($vmid, $i, $virtiofs);
+	# See https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1136
+	my $prefer_inode_fh = PVE::QemuServer::Helpers::windows_version($conf->{ostype}) ? 1 : 0;
+
+	my $virtiofs_socket = start_virtiofsd($vmid, $i, $virtiofs, $prefer_inode_fh);
 	push @$virtiofs_sockets, $virtiofs_socket;
     }
     return $virtiofs_sockets;
 }
 
 sub start_virtiofsd {
-    my ($vmid, $fsid, $virtiofs) = @_;
+    my ($vmid, $fsid, $virtiofs, $prefer_inode_fh) = @_;
 
     mkdir $socket_path_root;
     my $socket_path = "$socket_path_root/vm$vmid-fs$fsid";
@@ -175,6 +178,7 @@ sub start_virtiofsd {
 	    push @$cmd, '--announce-submounts';
 	    push @$cmd, '--allow-direct-io' if $virtiofs->{'direct-io'};
 	    push @$cmd, '--cache='.$virtiofs->{cache} if $virtiofs->{cache};
+	    push @$cmd, '--inode-file-handles=prefer' if $prefer_inode_fh;
 	    push @$cmd, '--syslog';
 	    exec(@$cmd);
 	} elsif (!defined($pid2)) {
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH v2 qemu-server] virtiofs: prevent issue with Windows OS and too many files
  2025-05-02 14:21 [pve-devel] [PATCH v2 qemu-server] virtiofs: prevent issue with Windows OS and too many files Fiona Ebner
@ 2025-06-02  6:20 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-06-02  6:20 UTC (permalink / raw)
  To: pve-devel, Fiona Ebner

On Fri, 02 May 2025 16:21:33 +0200, Fiona Ebner wrote:
> As reported in the community forum [0] and the virtio-win project [1],
> virtiofsd will run into its open file limit when used with a Windows
> guest that reads too many files. It's also reported that the issue
> does not occur with Linux guests and a workaround is using
> '--inode-file-handles=mandatory' on virtiofsd command line.
> 
> The option is described as follows in the virtiofsd help:
> 
> [...]

Applied, thanks!

[1/1] virtiofs: prevent issue with Windows OS and too many files
      commit: c7cd00516d66e08463a3e0e363dde3b4fd5f18b6


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-02  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-02 14:21 [pve-devel] [PATCH v2 qemu-server] virtiofs: prevent issue with Windows OS and too many files Fiona Ebner
2025-06-02  6:20 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal