diff mbox series

[v2,109/109] virtiofsd: add some options to the help message

Message ID 20200121122433.50803-110-dgilbert@redhat.com
State New
Headers show
Series virtiofs daemon [all] | expand

Commit Message

Dr. David Alan Gilbert Jan. 21, 2020, 12:24 p.m. UTC
From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>

Add following options to the help message:
- cache
- flock|no_flock
- norace
- posix_lock|no_posix_lock
- readdirplus|no_readdirplus
- timeout
- writeback|no_writeback
- xattr|no_xattr

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>

dgilbert: Split cache, norace, posix_lock, readdirplus off
  into our own earlier patches that added the options

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 tools/virtiofsd/helper.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Misono Tomohiro Jan. 22, 2020, 6:35 a.m. UTC | #1
> From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> 
> Add following options to the help message:
> - cache
> - flock|no_flock
> - norace
> - posix_lock|no_posix_lock
> - readdirplus|no_readdirplus
> - timeout
> - writeback|no_writeback
> - xattr|no_xattr
> 
> Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> 
> dgilbert: Split cache, norace, posix_lock, readdirplus off
>   into our own earlier patches that added the options
> 
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com><Paste>

Hello,

I think we also need to remove unused options from help message as well.
Could you please review following patch and add or fold to this patch
if it is ok.

Thanks,
Misono

=====
[PATCH] virtiofsd: Remove unused options

Following options came from libfuse but not used in virtiofs:
 - allow_other (always set to 1 in guest kernel)
 - auto_unmount
 - -s (singlethread)

Let's remove unused options from help in order not to confuse users.

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
---
 tools/virtiofsd/fuse_lowlevel.c | 12 +++---------
 tools/virtiofsd/fuse_lowlevel.h |  1 -
 tools/virtiofsd/helper.c        |  2 --
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index 2ce3e739fd..00554c6aa7 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -2539,11 +2539,9 @@ void fuse_lowlevel_help(void)
      * potentially of interest to an end-user
      */
     printf(
-        "    -o allow_other             allow access by all users\n"
         "    -o allow_root              allow access by root\n"
         "    --socket-path=PATH         path for the vhost-user socket\n"
         "    --fd=FDNUM                 fd number of vhost-user socket\n"
-        "    -o auto_unmount            auto unmount on process termination\n"
         "    --thread-pool-size=NUM     thread pool size limit (default %d)\n",
         THREAD_POOL_SIZE);
 }
@@ -2612,14 +2610,10 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
          * Allowing access only by root is done by instructing
          * kernel to allow access by everyone, and then restricting
          * access to root and mountpoint owner in libfuse.
+         *
+         * Note: allow_other is set to 1 in guest kernel for virtiofs
+         * so nothing needs to be done here
          */
-        /*
-         * We may be adding the option a second time, but
-         * that doesn't hurt.
-         */
-        if (fuse_opt_add_arg(args, "-oallow_other") == -1) {
-            goto out2;
-        }
     }
     if (args->argc == 1 && args->argv[0][0] == '-') {
         fuse_log(FUSE_LOG_ERR,
diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
index 3a7213f42f..aa5f62c846 100644
--- a/tools/virtiofsd/fuse_lowlevel.h
+++ b/tools/virtiofsd/fuse_lowlevel.h
@@ -1820,7 +1820,6 @@ void fuse_cmdline_help(void);
  */
 
 struct fuse_cmdline_opts {
-    int singlethread;
     int foreground;
     int debug;
     int nodefault_subtype;
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 8f00737b1a..9dd4199800 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -47,7 +47,6 @@ static const struct fuse_opt fuse_helper_opts[] = {
     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),
     FUSE_HELPER_OPT("subtype=", nodefault_subtype),
@@ -145,7 +144,6 @@ void fuse_cmdline_help(void)
            "    --syslog                   log to syslog (default stderr)\n"
            "    -f                         foreground operation\n"
            "    --daemonize                run in background\n"
-           "    -s                         disable multi-threaded operation\n"
            "    -o cache=<mode>            cache mode. could be one of \"auto, "
            "always, none\"\n"
            "                               default: auto\n"
Dr. David Alan Gilbert Jan. 22, 2020, 6:11 p.m. UTC | #2
* Misono Tomohiro (misono.tomohiro@jp.fujitsu.com) wrote:
> > From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> > 
> > Add following options to the help message:
> > - cache
> > - flock|no_flock
> > - norace
> > - posix_lock|no_posix_lock
> > - readdirplus|no_readdirplus
> > - timeout
> > - writeback|no_writeback
> > - xattr|no_xattr
> > 
> > Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> > 
> > dgilbert: Split cache, norace, posix_lock, readdirplus off
> >   into our own earlier patches that added the options
> > 
> > Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com><Paste>
> 
> Hello,
> 
> I think we also need to remove unused options from help message as well.
> Could you please review following patch and add or fold to this patch
> if it is ok.
> 
> Thanks,
> Misono

Thanks, I've merged that into the 'Trim down imported files'

> =====
> [PATCH] virtiofsd: Remove unused options
> 
> Following options came from libfuse but not used in virtiofs:
>  - allow_other (always set to 1 in guest kernel)
>  - auto_unmount
>  - -s (singlethread)
> 
> Let's remove unused options from help in order not to confuse users.
> 
> Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
> ---
>  tools/virtiofsd/fuse_lowlevel.c | 12 +++---------
>  tools/virtiofsd/fuse_lowlevel.h |  1 -
>  tools/virtiofsd/helper.c        |  2 --
>  3 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
> index 2ce3e739fd..00554c6aa7 100644
> --- a/tools/virtiofsd/fuse_lowlevel.c
> +++ b/tools/virtiofsd/fuse_lowlevel.c
> @@ -2539,11 +2539,9 @@ void fuse_lowlevel_help(void)
>       * potentially of interest to an end-user
>       */
>      printf(
> -        "    -o allow_other             allow access by all users\n"
>          "    -o allow_root              allow access by root\n"
>          "    --socket-path=PATH         path for the vhost-user socket\n"
>          "    --fd=FDNUM                 fd number of vhost-user socket\n"
> -        "    -o auto_unmount            auto unmount on process termination\n"
>          "    --thread-pool-size=NUM     thread pool size limit (default %d)\n",
>          THREAD_POOL_SIZE);
>  }
> @@ -2612,14 +2610,10 @@ struct fuse_session *fuse_session_new(struct fuse_args *args,
>           * Allowing access only by root is done by instructing
>           * kernel to allow access by everyone, and then restricting
>           * access to root and mountpoint owner in libfuse.
> +         *
> +         * Note: allow_other is set to 1 in guest kernel for virtiofs
> +         * so nothing needs to be done here
>           */
> -        /*
> -         * We may be adding the option a second time, but
> -         * that doesn't hurt.
> -         */
> -        if (fuse_opt_add_arg(args, "-oallow_other") == -1) {
> -            goto out2;
> -        }
>      }

I took out the surrounding 'if' as well because there was nothing left
except for the comment.

Dave

>      if (args->argc == 1 && args->argv[0][0] == '-') {
>          fuse_log(FUSE_LOG_ERR,
> diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
> index 3a7213f42f..aa5f62c846 100644
> --- a/tools/virtiofsd/fuse_lowlevel.h
> +++ b/tools/virtiofsd/fuse_lowlevel.h
> @@ -1820,7 +1820,6 @@ void fuse_cmdline_help(void);
>   */
>  
>  struct fuse_cmdline_opts {
> -    int singlethread;
>      int foreground;
>      int debug;
>      int nodefault_subtype;
> diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
> index 8f00737b1a..9dd4199800 100644
> --- a/tools/virtiofsd/helper.c
> +++ b/tools/virtiofsd/helper.c
> @@ -47,7 +47,6 @@ static const struct fuse_opt fuse_helper_opts[] = {
>      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),
>      FUSE_HELPER_OPT("subtype=", nodefault_subtype),
> @@ -145,7 +144,6 @@ void fuse_cmdline_help(void)
>             "    --syslog                   log to syslog (default stderr)\n"
>             "    -f                         foreground operation\n"
>             "    --daemonize                run in background\n"
> -           "    -s                         disable multi-threaded operation\n"
>             "    -o cache=<mode>            cache mode. could be one of \"auto, "
>             "always, none\"\n"
>             "                               default: auto\n"
> -- 
> 2.21.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox series

Patch

diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index a19959926c..8f00737b1a 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -149,6 +149,8 @@  void fuse_cmdline_help(void)
            "    -o cache=<mode>            cache mode. could be one of \"auto, "
            "always, none\"\n"
            "                               default: auto\n"
+           "    -o flock|no_flock          enable/disable flock\n"
+           "                               default: no_flock\n"
            "    -o log_level=<level>       log level, default to \"info\"\n"
            "                               level could be one of \"debug, "
            "info, warn, err\"\n"
@@ -163,7 +165,13 @@  void fuse_cmdline_help(void)
            "    -o readdirplus|no_readdirplus\n"
            "                               enable/disable readirplus\n"
            "                               default: readdirplus\n"
-          );
+           "    -o timeout=<number>        I/O timeout (second)\n"
+           "                               default: depends on cache= option.\n"
+           "    -o writeback|no_writeback  enable/disable writeback cache\n"
+           "                               default: no_writeback\n"
+           "    -o xattr|no_xattr          enable/disable xattr\n"
+           "                               default: no_xattr\n"
+           );
 }
 
 static int fuse_helper_opt_proc(void *data, const char *arg, int key,