Revisión | 6a7e2bbee5fa5f167959f05319550d2a49a6b8bb (tree) |
---|---|
Tiempo | 2020-02-11 02:25:52 |
Autor | Stefan Hajnoczi <stefanha@redh...> |
Commiter | Dr. David Alan Gilbert |
docs: add virtiofsd(1) man page
Document the virtiofsd(1) program and its command-line options. This
man page is a rST conversion of the original texi documentation that I
wrote.
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
@@ -1613,6 +1613,7 @@ S: Supported | ||
1613 | 1613 | F: tools/virtiofsd/* |
1614 | 1614 | F: hw/virtio/vhost-user-fs* |
1615 | 1615 | F: include/hw/virtio/vhost-user-fs.h |
1616 | +F: docs/interop/virtiofsd.rst | |
1616 | 1617 | |
1617 | 1618 | virtio-input |
1618 | 1619 | M: Gerd Hoffmann <kraxel@redhat.com> |
@@ -348,6 +348,9 @@ DOCS=qemu-doc.html qemu-doc.txt qemu.1 | ||
348 | 348 | DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-img.1 |
349 | 349 | DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-nbd.8 |
350 | 350 | DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8 |
351 | +ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) | |
352 | +DOCS+=$(MANUAL_BUILDDIR)/interop/virtiofsd.1 | |
353 | +endif | |
351 | 354 | DOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 |
352 | 355 | DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7 |
353 | 356 | DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7 |
@@ -861,6 +864,9 @@ ifdef CONFIG_VIRTFS | ||
861 | 864 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" |
862 | 865 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" |
863 | 866 | endif |
867 | +ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) | |
868 | + $(INSTALL_DATA) docs/interop/virtiofsd.1 "$(DESTDIR)$(mandir)/man1" | |
869 | +endif | |
864 | 870 | |
865 | 871 | install-datadir: |
866 | 872 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" |
@@ -1051,7 +1057,8 @@ $(MANUAL_BUILDDIR)/system/index.html: $(call manual-deps,system) | ||
1051 | 1057 | $(call build-manual,system,html) |
1052 | 1058 | |
1053 | 1059 | $(call define-manpage-rule,interop,\ |
1054 | - qemu-ga.8 qemu-img.1 qemu-nbd.8 qemu-trace-stap.1 virtfs-proxy-helper.1,\ | |
1060 | + qemu-ga.8 qemu-img.1 qemu-nbd.8 qemu-trace-stap.1\ | |
1061 | + virtiofsd.1 virtfs-proxy-helper.1,\ | |
1055 | 1062 | $(SRC_PATH/qemu-img-cmds.hx)) |
1056 | 1063 | |
1057 | 1064 | $(call define-manpage-rule,system,qemu-block-drivers.7) |
@@ -27,5 +27,8 @@ man_pages = [ | ||
27 | 27 | [], 1), |
28 | 28 | ('virtfs-proxy-helper', 'virtfs-proxy-helper', |
29 | 29 | u'QEMU 9p virtfs proxy filesystem helper', |
30 | - ['M. Mohan Kumar'], 1) | |
30 | + ['M. Mohan Kumar'], 1), | |
31 | + ('virtiofsd', 'virtiofsd', u'QEMU virtio-fs shared file system daemon', | |
32 | + ['Stefan Hajnoczi <stefanha@redhat.com>', | |
33 | + 'Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>'], 1), | |
31 | 34 | ] |
@@ -24,3 +24,4 @@ Contents: | ||
24 | 24 | vhost-user |
25 | 25 | vhost-user-gpu |
26 | 26 | virtfs-proxy-helper |
27 | + virtiofsd |
@@ -0,0 +1,120 @@ | ||
1 | +QEMU virtio-fs shared file system daemon | |
2 | +======================================== | |
3 | + | |
4 | +Synopsis | |
5 | +-------- | |
6 | + | |
7 | +**virtiofsd** [*OPTIONS*] | |
8 | + | |
9 | +Description | |
10 | +----------- | |
11 | + | |
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. | |
15 | + | |
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. | |
19 | + | |
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. | |
27 | + | |
28 | +Options | |
29 | +------- | |
30 | + | |
31 | +.. program:: virtiofsd | |
32 | + | |
33 | +.. option:: -h, --help | |
34 | + | |
35 | + Print help. | |
36 | + | |
37 | +.. option:: -V, --version | |
38 | + | |
39 | + Print version. | |
40 | + | |
41 | +.. option:: -d | |
42 | + | |
43 | + Enable debug output. | |
44 | + | |
45 | +.. option:: --syslog | |
46 | + | |
47 | + Print log messages to syslog instead of stderr. | |
48 | + | |
49 | +.. option:: -o OPTION | |
50 | + | |
51 | + * debug - | |
52 | + Enable debug output. | |
53 | + | |
54 | + * flock|no_flock - | |
55 | + Enable/disable flock. The default is ``no_flock``. | |
56 | + | |
57 | + * log_level=LEVEL - | |
58 | + Print only log messages matching LEVEL or more severe. LEVEL is one of | |
59 | + ``err``, ``warn``, ``info``, or ``debug``. The default is ``info``. | |
60 | + | |
61 | + * norace - | |
62 | + Disable racy fallback. The default is false. | |
63 | + | |
64 | + * posix_lock|no_posix_lock - | |
65 | + Enable/disable remote POSIX locks. The default is ``posix_lock``. | |
66 | + | |
67 | + * readdirplus|no_readdirplus - | |
68 | + Enable/disable readdirplus. The default is ``readdirplus``. | |
69 | + | |
70 | + * source=PATH - | |
71 | + Share host directory tree located at PATH. This option is required. | |
72 | + | |
73 | + * timeout=TIMEOUT - | |
74 | + I/O timeout in seconds. The default depends on cache= option. | |
75 | + | |
76 | + * writeback|no_writeback - | |
77 | + Enable/disable writeback cache. The cache alows the FUSE client to buffer | |
78 | + and merge write requests. The default is ``no_writeback``. | |
79 | + | |
80 | + * xattr|no_xattr - | |
81 | + Enable/disable extended attributes (xattr) on files and directories. The | |
82 | + default is ``no_xattr``. | |
83 | + | |
84 | +.. option:: --socket-path=PATH | |
85 | + | |
86 | + Listen on vhost-user UNIX domain socket at PATH. | |
87 | + | |
88 | +.. option:: --fd=FDNUM | |
89 | + | |
90 | + Accept connections from vhost-user UNIX domain socket file descriptor FDNUM. | |
91 | + The file descriptor must already be listening for connections. | |
92 | + | |
93 | +.. option:: --thread-pool-size=NUM | |
94 | + | |
95 | + Restrict the number of worker threads per request queue to NUM. The default | |
96 | + is 64. | |
97 | + | |
98 | +.. option:: --cache=none|auto|always | |
99 | + | |
100 | + Select the desired trade-off between coherency and performance. ``none`` | |
101 | + forbids the FUSE client from caching to achieve best coherency at the cost of | |
102 | + performance. ``auto`` acts similar to NFS with a 1 second metadata cache | |
103 | + timeout. ``always`` sets a long cache lifetime at the expense of coherency. | |
104 | + | |
105 | +Examples | |
106 | +-------- | |
107 | + | |
108 | +Export ``/var/lib/fs/vm001/`` on vhost-user UNIX domain socket | |
109 | +``/var/run/vm001-vhost-fs.sock``: | |
110 | + | |
111 | +:: | |
112 | + | |
113 | + host# virtiofsd --socket-path=/var/run/vm001-vhost-fs.sock -o source=/var/lib/fs/vm001 | |
114 | + host# qemu-system-x86_64 \ | |
115 | + -chardev socket,id=char0,path=/var/run/vm001-vhost-fs.sock \ | |
116 | + -device vhost-user-fs-pci,chardev=char0,tag=myfs \ | |
117 | + -object memory-backend-memfd,id=mem,size=4G,share=on \ | |
118 | + -numa node,memdev=mem \ | |
119 | + ... | |
120 | + guest# mount -t virtiofs myfs /mnt |