[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 27/30] virtiofsd: make -f (foreground) the default
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH 27/30] virtiofsd: make -f (foreground) the default |
Date: |
Mon, 21 Oct 2019 11:58:29 +0100 |
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>
---
contrib/virtiofsd/helper.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/contrib/virtiofsd/helper.c b/contrib/virtiofsd/helper.c
index f67533f053..ab20810c28 100644
--- a/contrib/virtiofsd/helper.c
+++ b/contrib/virtiofsd/helper.c
@@ -26,6 +26,9 @@
#define FUSE_HELPER_OPT(t, p) \
{ 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),
@@ -39,6 +42,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),
@@ -130,6 +134,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"
" (may improve performance)\n"
@@ -160,6 +165,7 @@ int fuse_parse_cmdline(struct fuse_args *args,
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
- Re: [PATCH 17/30] virtiofsd: Add main virtio loop, (continued)
- [PATCH 19/30] virtiofsd: Start queue threads, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 20/30] virtiofsd: Poll kick_fd for queue, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 18/30] virtiofsd: get/set features callbacks, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 23/30] virtiofsd: Keep track of replies, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 22/30] virtiofsd: Send replies to messages, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 21/30] virtiofsd: Start reading commands from queue, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 27/30] virtiofsd: make -f (foreground) the default,
Dr. David Alan Gilbert (git) <=
- [PATCH 24/30] virtiofsd: Add Makefile wiring for virtiofsd contrib, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 26/30] virtiofsd: add --fd=FDNUM fd passing option, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 25/30] virtiofsd: Fast path for virtio read, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 29/30] virtiofsd: add --print-capabilities option, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 30/30] virtiofs: Add maintainers entry, Dr. David Alan Gilbert (git), 2019/10/21
- [PATCH 28/30] virtiofsd: add vhost-user.json file, Dr. David Alan Gilbert (git), 2019/10/21
- Re: [PATCH 00/30] virtiofs daemon (base), no-reply, 2019/10/21