qemu-server/PVE/QemuServer
Markus Frank 87b22e3839 fix #1027: virtio-fs support
Add support for sharing directories with a guest VM.

virtio-fs needs virtiofsd to be started. In order to start virtiofsd
as a process (despite being a daemon it is does not run in the
background), a double-fork is used.

virtiofsd should close itself together with QEMU.

There are the parameters dirid and the optional parameters direct-io,
cache and writeback. Additionally the expose-xattr & expose-acl
parameter can be set to expose xattr & acl settings from the shared
filesystem to the guest system.

The dirid gets mapped to the path on the current node and is also used
as a mount tag (name used to mount the device on the guest).

example config:
```
virtiofs0: foo,direct-io=1,cache=always,expose-acl=1
virtiofs1: dirid=bar,cache=never,expose-xattr=1,writeback=1
```

For information on the optional parameters see the coherent doc patch
and the official gitlab README:
https://gitlab.com/virtio-fs/virtiofsd/-/blob/main/README.md

Also add a permission check for virtiofs directory access.

Add virtiofsd to the Recommends list for the qemu-server Debian
package, this allows users to opt-out of installing this package, e.g.
for certification reasons.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Link: https://lore.proxmox.com/20250407134950.265270-3-m.frank@proxmox.com
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
 [TL: squash d/control change and re-add Lukas' T-b, as nothing
  essentially changed from the v16 where his tag applied]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 22:30:11 +02:00
..
Agent.pm tree wide cleanup of s/return undef/return/ 2020-10-16 16:20:05 +02:00
CGroup.pm fix #5528: override cgroup methods to call systemd via dbus 2024-07-23 08:05:53 +02:00
Cloudinit.pm config: make special section handling generic 2025-04-07 14:13:01 +02:00
CPUConfig.pm cpu config: sev type: small code style fix 2025-04-03 20:55:12 +02:00
Drive.pm drive: remove ancient 'cow' from formats 2025-04-03 18:41:17 +02:00
Helpers.pm move get_vm_arch() helper to helpers module 2025-01-17 19:24:02 +01:00
ImportDisk.pm image convert: collect options in hash argument 2025-04-06 20:18:52 +02:00
Machine.pm machine: improve code style in get_pve_version 2025-04-07 17:30:16 +02:00
Makefile fix #1027: virtio-fs support 2025-04-07 22:30:11 +02:00
Memory.pm fix #1027: virtio-fs support 2025-04-07 22:30:11 +02:00
MetaInfo.pm move meta information handling to its own module 2025-01-17 19:24:02 +01:00
Monitor.pm monitor: allow passing timeout for a HMP command 2024-06-11 13:56:44 +02:00
PCI.pm pci passthrough: enable live-migration for capable mapped-devices 2025-04-03 16:38:36 +02:00
QMPHelpers.pm qmp helpers: device add/del: use HMP interface 2025-02-04 17:07:19 +01:00
RNG.pm add helpers for VirtIO RNG command line arguments 2025-04-04 10:25:33 +02:00
USB.pm fix typos in user-visible strings 2024-10-24 13:15:06 +02:00
Virtiofs.pm fix #1027: virtio-fs support 2025-04-07 22:30:11 +02:00