Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge tag 'pull-9p-20230706' of https://github.com/cschoenebeck/qemu
…into staging

Administrative changes only:

* Deprecate 9p 'proxy' backend.

* Raise status of 9p to 'Maintained'.

# -----BEGIN PGP SIGNATURE-----
#
# iQJLBAABCgA1FiEEltjREM96+AhPiFkBNMK1h2Wkc5UFAmSmkAsXHHFlbXVfb3Nz
# QGNydWRlYnl0ZS5jb20ACgkQNMK1h2Wkc5We1xAAol+HbhQ2zNCJUbZ2/WY3Jf0H
# K86DRQIs6w6UkL9msFz+id+tR5i50HoJ3+RnOKvy/fPqO8Rv6mb0d9r+bIG1JJCc
# ubHP91x/nyDbP0XbLMtmtCz/T4g67E11Qqriq7lH1bPF7ccU3iXHZNup9HARjOoE
# SQo9x4e7IDi1WdmM2vjvRXCh4ZLIlBv7c+2vAeP4V7FhJhDkL+1y+w6aCFw0xpd8
# lto3Egnhz6pk7+SJfQwCl3rfozHhCxlNmcNa+7vqckVFpdJrvtKOQB4cn9yVDPr/
# WjmYoB2J3MwYuZz+qAkdRJ6dUTLJb87YqJJe6lcKq0lqjiFBk7TccvIN9WgyJQd/
# eLUPCCyo98g9RCaPzjLc4MgbpCPCmqJkg8A1vJzykvq51BqJZcdkwfJ7LFmsvTSo
# IfR1Seq4OUUzTZ2gWh8wJBNcPpAbilHzQnumxBEupe0Dg/pwoQWCywTYJN6Yf/6+
# PzcK39bVFKrEyc4Z1Y/yXvAzD7nX8X78kSHvxYYEQfzruLIVQjUUQ7Mp3TiJvljk
# mLdcYqavjawgC2zmZU4L2Lx4Su7iVIkhNWj57WkfooSzLrAjueYQIJEltAt8Qmn6
# x3+u3xI/myNKujMpaqgTAU5Gk2J2UApshq5Zwe8HpnVwWoxS3QetXdA/f4AXwZOk
# TpnKPYQa7edPLSSAbAs=
# =GzjR
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 06 Jul 2023 10:57:31 AM BST
# gpg:                using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395
# gpg:                issuer "qemu_oss@crudebyte.com"
# gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: ECAB 1A45 4014 1413 BA38  4926 30DB 47C3 A012 D5F4
#      Subkey fingerprint: 96D8 D110 CF7A F808 4F88  5901 34C2 B587 65A4 7395

* tag 'pull-9p-20230706' of https://github.com/cschoenebeck/qemu:
  MAINTAINERS: raise status of 9p to 'Maintained'
  9pfs: deprecate 'proxy' backend

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jul 6, 2023
2 parents 822cb97 + 3548fa0 commit 97c81ef
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 4 deletions.
11 changes: 9 additions & 2 deletions MAINTAINERS
Expand Up @@ -2120,17 +2120,24 @@ F: include/sysemu/balloon.h
virtio-9p
M: Greg Kurz <groug@kaod.org>
M: Christian Schoenebeck <qemu_oss@crudebyte.com>
S: Odd Fixes
S: Maintained
W: https://wiki.qemu.org/Documentation/9p
F: hw/9pfs/
X: hw/9pfs/xen-9p*
X: hw/9pfs/9p-proxy*
F: fsdev/
F: docs/tools/virtfs-proxy-helper.rst
X: fsdev/virtfs-proxy-helper.c
F: tests/qtest/virtio-9p-test.c
F: tests/qtest/libqos/virtio-9p*
T: git https://gitlab.com/gkurz/qemu.git 9p-next
T: git https://github.com/cschoenebeck/qemu.git 9p.next

virtio-9p-proxy
F: hw/9pfs/9p-proxy*
F: fsdev/virtfs-proxy-helper.c
F: docs/tools/virtfs-proxy-helper.rst
S: Obsolete

virtio-blk
M: Stefan Hajnoczi <stefanha@redhat.com>
L: qemu-block@nongnu.org
Expand Down
23 changes: 23 additions & 0 deletions docs/about/deprecated.rst
Expand Up @@ -343,6 +343,29 @@ the addition of volatile memory support, it is now necessary to distinguish
between persistent and volatile memory backends. As such, memdev is deprecated
in favor of persistent-memdev.

``-fsdev proxy`` and ``-virtfs proxy`` (since 8.1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The 9p ``proxy`` filesystem backend driver has been deprecated and will be
removed (along with its proxy helper daemon) in a future version of QEMU. Please
use ``-fsdev local`` or ``-virtfs local`` for using the 9p ``local`` filesystem
backend, or alternatively consider deploying virtiofsd instead.

The 9p ``proxy`` backend was originally developed as an alternative to the 9p
``local`` backend. The idea was to enhance security by dispatching actual low
level filesystem operations from 9p server (QEMU process) over to a separate
process (the virtfs-proxy-helper binary). However this alternative never gained
momentum. The proxy backend is much slower than the local backend, hasn't seen
any development in years, and showed to be less secure, especially due to the
fact that its helper daemon must be run as root, whereas with the local backend
QEMU is typically run as unprivileged user and allows to tighten behaviour by
mapping permissions et al by using its 'mapped' security model option.

Nowadays it would make sense to reimplement the ``proxy`` backend by using
QEMU's ``vhost`` feature, which would eliminate the high latency costs under
which the 9p ``proxy`` backend currently suffers. However as of to date nobody
has indicated plans for such kind of reimplemention unfortunately.


Block device options
''''''''''''''''''''
Expand Down
3 changes: 3 additions & 0 deletions docs/tools/virtfs-proxy-helper.rst
Expand Up @@ -9,6 +9,9 @@ Synopsis
Description
-----------

NOTE: The 9p 'proxy' backend is deprecated (since QEMU 8.1) and will be
removed, along with this daemon, in a future version of QEMU!

Pass-through security model in QEMU 9p server needs root privilege to do
few file operations (like chown, chmod to any mode/uid:gid). There are two
issues in pass-through security model:
Expand Down
8 changes: 8 additions & 0 deletions fsdev/qemu-fsdev.c
Expand Up @@ -133,6 +133,14 @@ int qemu_fsdev_add(QemuOpts *opts, Error **errp)
}

if (fsdriver) {
if (strncmp(fsdriver, "proxy", 5) == 0) {
warn_report(
"'-fsdev proxy' and '-virtfs proxy' are deprecated, use "
"'local' instead of 'proxy, or consider deploying virtiofsd "
"as alternative to 9p"
);
}

for (i = 0; i < ARRAY_SIZE(FsDrivers); i++) {
if (strcmp(FsDrivers[i].name, fsdriver) == 0) {
break;
Expand Down
9 changes: 9 additions & 0 deletions fsdev/virtfs-proxy-helper.c
Expand Up @@ -9,6 +9,11 @@
* the COPYING file in the top-level directory.
*/

/*
* NOTE: The 9p 'proxy' backend is deprecated (since QEMU 8.1) and will be
* removed in a future version of QEMU!
*/

#include "qemu/osdep.h"
#include <glib/gstdio.h>
#include <sys/resource.h>
Expand Down Expand Up @@ -1057,6 +1062,10 @@ int main(int argc, char **argv)
struct statfs st_fs;
#endif

fprintf(stderr, "NOTE: The 9p 'proxy' backend is deprecated (since "
"QEMU 8.1) and will be removed in a future version of "
"QEMU!\n");

prog_name = g_path_get_basename(argv[0]);

is_daemon = true;
Expand Down
5 changes: 5 additions & 0 deletions hw/9pfs/9p-proxy.c
Expand Up @@ -15,6 +15,11 @@
* https://wiki.qemu.org/Documentation/9p
*/

/*
* NOTE: The 9p 'proxy' backend is deprecated (since QEMU 8.1) and will be
* removed in a future version of QEMU!
*/

#include "qemu/osdep.h"
#include <sys/socket.h>
#include <sys/un.h>
Expand Down
5 changes: 5 additions & 0 deletions hw/9pfs/9p-proxy.h
Expand Up @@ -10,6 +10,11 @@
* the COPYING file in the top-level directory.
*/

/*
* NOTE: The 9p 'proxy' backend is deprecated (since QEMU 8.1) and will be
* removed in a future version of QEMU!
*/

#ifndef QEMU_9P_PROXY_H
#define QEMU_9P_PROXY_H

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Expand Up @@ -4179,7 +4179,7 @@ if have_block
summary_info += {'Block whitelist (ro)': get_option('block_drv_ro_whitelist')}
summary_info += {'Use block whitelist in tools': get_option('block_drv_whitelist_in_tools')}
summary_info += {'VirtFS (9P) support': have_virtfs}
summary_info += {'VirtFS (9P) Proxy Helper support': have_virtfs_proxy_helper}
summary_info += {'VirtFS (9P) Proxy Helper support (deprecated)': have_virtfs_proxy_helper}
summary_info += {'Live block migration': config_host_data.get('CONFIG_LIVE_BLOCK_MIGRATION')}
summary_info += {'replication support': config_host_data.get('CONFIG_REPLICATION')}
summary_info += {'bochs support': get_option('bochs').allowed()}
Expand Down
6 changes: 5 additions & 1 deletion qemu-options.hx
Expand Up @@ -1735,7 +1735,9 @@ SRST
Accesses to the filesystem are done by QEMU.

``proxy``
Accesses to the filesystem are done by virtfs-proxy-helper(1).
Accesses to the filesystem are done by virtfs-proxy-helper(1). This
option is deprecated (since QEMU 8.1) and will be removed in a future
version of QEMU. Use ``local`` instead.

``synth``
Synthetic filesystem, only used by QTests.
Expand Down Expand Up @@ -1867,6 +1869,8 @@ SRST

``proxy``
Accesses to the filesystem are done by virtfs-proxy-helper(1).
This option is deprecated (since QEMU 8.1) and will be removed in a
future version of QEMU. Use ``local`` instead.

``synth``
Synthetic filesystem, only used by QTests.
Expand Down

0 comments on commit 97c81ef

Please sign in to comment.