diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2019-08-27 10:54:34 +0100 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2020-01-23 16:41:36 +0000 |
commit | 0bbd31753714ac2899efda0f0de31e353e965789 (patch) | |
tree | dc0983a5066d2aa854755d0cdc98a29028562ca9 /tools/virtiofsd/helper.c | |
parent | cee8e35d4386e34bf79c3ca2aab7f7b1bb48cf8d (diff) |
virtiofsd: make -f (foreground) the default
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 <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd/helper.c')
-rw-r--r-- | tools/virtiofsd/helper.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c index 676032e71f..a3645fc807 100644 --- a/tools/virtiofsd/helper.c +++ b/tools/virtiofsd/helper.c @@ -29,6 +29,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), @@ -42,6 +47,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("fsname=", nodefault_subtype), FUSE_OPT_KEY("fsname=", FUSE_OPT_KEY_KEEP), FUSE_HELPER_OPT("subtype=", nodefault_subtype), @@ -131,6 +137,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" " -o max_idle_threads the maximum number of idle worker " "threads\n" " allowed (default: 10)\n"); @@ -158,6 +165,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) { |