virtiofsd: Remove "norace" from cmdline help and docs
[qemu/ar7.git] / docs / tools / virtiofsd.rst
blobe33c81ed41f183ea3ccf68c253c9c346965efe84
1 QEMU virtio-fs shared file system daemon
2 ========================================
4 Synopsis
5 --------
7 **virtiofsd** [*OPTIONS*]
9 Description
10 -----------
12 Share a host directory tree with a guest through a virtio-fs device.  This
13 program is a vhost-user backend that implements the virtio-fs device.  Each
14 virtio-fs device instance requires its own virtiofsd process.
16 This program is designed to work with QEMU's ``--device vhost-user-fs-pci``
17 but should work with any virtual machine monitor (VMM) that supports
18 vhost-user.  See the Examples section below.
20 This program must be run as the root user.  Upon startup the program will
21 switch into a new file system namespace with the shared directory tree as its
22 root.  This prevents "file system escapes" due to symlinks and other file
23 system objects that might lead to files outside the shared directory.  The
24 program also sandboxes itself using seccomp(2) to prevent ptrace(2) and other
25 vectors that could allow an attacker to compromise the system after gaining
26 control of the virtiofsd process.
28 Options
29 -------
31 .. program:: virtiofsd
33 .. option:: -h, --help
35   Print help.
37 .. option:: -V, --version
39   Print version.
41 .. option:: -d
43   Enable debug output.
45 .. option:: --syslog
47   Print log messages to syslog instead of stderr.
49 .. option:: -o OPTION
51   * debug -
52     Enable debug output.
54   * flock|no_flock -
55     Enable/disable flock.  The default is ``no_flock``.
57   * modcaps=CAPLIST
58     Modify the list of capabilities allowed; CAPLIST is a colon separated
59     list of capabilities, each preceded by either + or -, e.g.
60     ''+sys_admin:-chown''.
62   * log_level=LEVEL -
63     Print only log messages matching LEVEL or more severe.  LEVEL is one of
64     ``err``, ``warn``, ``info``, or ``debug``.  The default is ``info``.
66   * posix_lock|no_posix_lock -
67     Enable/disable remote POSIX locks.  The default is ``no_posix_lock``.
69   * readdirplus|no_readdirplus -
70     Enable/disable readdirplus.  The default is ``readdirplus``.
72   * source=PATH -
73     Share host directory tree located at PATH.  This option is required.
75   * timeout=TIMEOUT -
76     I/O timeout in seconds.  The default depends on cache= option.
78   * writeback|no_writeback -
79     Enable/disable writeback cache. The cache alows the FUSE client to buffer
80     and merge write requests.  The default is ``no_writeback``.
82   * xattr|no_xattr -
83     Enable/disable extended attributes (xattr) on files and directories.  The
84     default is ``no_xattr``.
86 .. option:: --socket-path=PATH
88   Listen on vhost-user UNIX domain socket at PATH.
90 .. option:: --fd=FDNUM
92   Accept connections from vhost-user UNIX domain socket file descriptor FDNUM.
93   The file descriptor must already be listening for connections.
95 .. option:: --thread-pool-size=NUM
97   Restrict the number of worker threads per request queue to NUM.  The default
98   is 64.
100 .. option:: --cache=none|auto|always
102   Select the desired trade-off between coherency and performance.  ``none``
103   forbids the FUSE client from caching to achieve best coherency at the cost of
104   performance.  ``auto`` acts similar to NFS with a 1 second metadata cache
105   timeout.  ``always`` sets a long cache lifetime at the expense of coherency.
107 Examples
108 --------
110 Export ``/var/lib/fs/vm001/`` on vhost-user UNIX domain socket
111 ``/var/run/vm001-vhost-fs.sock``:
115   host# virtiofsd --socket-path=/var/run/vm001-vhost-fs.sock -o source=/var/lib/fs/vm001
116   host# qemu-system-x86_64 \
117       -chardev socket,id=char0,path=/var/run/vm001-vhost-fs.sock \
118       -device vhost-user-fs-pci,chardev=char0,tag=myfs \
119       -object memory-backend-memfd,id=mem,size=4G,share=on \
120       -numa node,memdev=mem \
121       ...
122   guest# mount -t virtiofs myfs /mnt