[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 028/104] virtiofsd: make -f (foreground) the default
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH 028/104] virtiofsd: make -f (foreground) the default |
Date: |
Thu, 12 Dec 2019 16:37:48 +0000 |
From: Stefan Hajnoczi <address@hidden>
According to vhost-user.rst "Backend program conventions", backend
programs should run in the foregound by default. Follow the
conventions so libvirt and other management tools can control virtiofsd
in a standard way.
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tools/virtiofsd/helper.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 48e38a7963..d4fff4fa53 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -28,6 +28,11 @@
{ \
t, offsetof(struct fuse_cmdline_opts, p), 1 \
}
+#define FUSE_HELPER_OPT_VALUE(t, p, v) \
+ { \
+ t, offsetof(struct fuse_cmdline_opts, p), v \
+ }
+
static const struct fuse_opt fuse_helper_opts[] = {
FUSE_HELPER_OPT("-h", show_help),
@@ -41,6 +46,7 @@ static const struct fuse_opt fuse_helper_opts[] = {
FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP),
FUSE_OPT_KEY("debug", FUSE_OPT_KEY_KEEP),
FUSE_HELPER_OPT("-f", foreground),
+ FUSE_HELPER_OPT_VALUE("--daemonize", foreground, 0),
FUSE_HELPER_OPT("-s", singlethread),
FUSE_HELPER_OPT("fsname=", nodefault_subtype),
FUSE_OPT_KEY("fsname=", FUSE_OPT_KEY_KEEP),
@@ -132,6 +138,7 @@ void fuse_cmdline_help(void)
" -V --version print version\n"
" -d -o debug enable debug output (implies -f)\n"
" -f foreground operation\n"
+ " --daemonize run in background\n"
" -s disable multi-threaded operation\n"
" -o clone_fd use separate fuse device fd for "
"each thread\n"
@@ -163,6 +170,7 @@ int fuse_parse_cmdline(struct fuse_args *args, struct
fuse_cmdline_opts *opts)
memset(opts, 0, sizeof(struct fuse_cmdline_opts));
opts->max_idle_threads = 10;
+ opts->foreground = 1;
if (fuse_opt_parse(args, opts, fuse_helper_opts, fuse_helper_opt_proc) ==
-1) {
--
2.23.0
- [PATCH 025/104] virtiofsd: Add Makefile wiring for virtiofsd contrib, (continued)
- [PATCH 025/104] virtiofsd: Add Makefile wiring for virtiofsd contrib, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 024/104] virtiofsd: Keep track of replies, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 026/104] virtiofsd: Fast path for virtio read, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 027/104] virtiofsd: add --fd=FDNUM fd passing option, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 022/104] virtiofsd: Start reading commands from queue, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 023/104] virtiofsd: Send replies to messages, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 030/104] virtiofsd: add --print-capabilities option, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 031/104] virtiofs: Add maintainers entry, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 028/104] virtiofsd: make -f (foreground) the default,
Dr. David Alan Gilbert (git) <=
- [PATCH 029/104] virtiofsd: add vhost-user.json file, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 032/104] virtiofsd: passthrough_ll: create new files in caller's context, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 033/104] virtiofsd: passthrough_ll: add lo_map for ino/fh indirection, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 034/104] virtiofsd: passthrough_ll: add ino_map to hide lo_inode pointers, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 036/104] virtiofsd: passthrough_ll: add fd_map to hide file descriptors, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 037/104] virtiofsd: passthrough_ll: add fallback for racy ops, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 038/104] virtiofsd: validate path components, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 040/104] virtiofsd: Pass write iov's all the way through, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 039/104] virtiofsd: Plumb fuse_bufvec through to do_write_buf, Dr. David Alan Gilbert (git), 2019/12/12
- [PATCH 035/104] virtiofsd: passthrough_ll: add dirp_map to hide lo_dirp pointers, Dr. David Alan Gilbert (git), 2019/12/12