virtiofsd: Add options for virtio
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 7 Jun 2018 16:22:33 +0000 (17:22 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 23 Jan 2020 16:41:36 +0000 (16:41 +0000)
Add options to specify parameters for virtio-fs paths, i.e.

   ./virtiofsd -o vhost_user_socket=/tmp/vhostqemu

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/fuse_i.h
tools/virtiofsd/fuse_lowlevel.c
tools/virtiofsd/helper.c

index bae06992e06d83d12b725dcbbc1e7c8604bbfc1a..26b1a7da88b93adfe7041a59f0ecd39803be9417 100644 (file)
@@ -63,6 +63,7 @@ struct fuse_session {
     struct fuse_notify_req notify_list;
     size_t bufsize;
     int error;
+    char *vu_socket_path;
 };
 
 struct fuse_chan {
index 8552cfb8af0dfb8c79a253908658670e9727498e..17e8718283f0c504abc865e7fa43f3ea72e84731 100644 (file)
@@ -2115,8 +2115,11 @@ reply_err:
     }
 
 static const struct fuse_opt fuse_ll_opts[] = {
-    LL_OPTION("debug", debug, 1), LL_OPTION("-d", debug, 1),
-    LL_OPTION("--debug", debug, 1), LL_OPTION("allow_root", deny_others, 1),
+    LL_OPTION("debug", debug, 1),
+    LL_OPTION("-d", debug, 1),
+    LL_OPTION("--debug", debug, 1),
+    LL_OPTION("allow_root", deny_others, 1),
+    LL_OPTION("--socket-path=%s", vu_socket_path, 0),
     FUSE_OPT_END
 };
 
@@ -2132,7 +2135,9 @@ void fuse_lowlevel_help(void)
      * These are not all options, but the ones that are
      * potentially of interest to an end-user
      */
-    printf("    -o allow_root          allow access by root\n");
+    printf(
+        "    -o allow_root              allow access by root\n"
+        "    --socket-path=PATH         path for the vhost-user socket\n");
 }
 
 void fuse_session_destroy(struct fuse_session *se)
index 93336915252efe2a28530a6638620196339fc6f0..676032e71f4cae49f4cb1e24d070141eb515dfeb 100644 (file)
@@ -127,13 +127,13 @@ static const struct fuse_opt conn_info_opt_spec[] = {
 
 void fuse_cmdline_help(void)
 {
-    printf(
-        "    -h   --help            print help\n"
-        "    -V   --version         print version\n"
-        "    -d   -o debug          enable debug output (implies -f)\n"
-        "    -f                     foreground operation\n"
-        "    -o max_idle_threads    the maximum number of idle worker threads\n"
-        "                           allowed (default: 10)\n");
+    printf("    -h   --help                print help\n"
+           "    -V   --version             print version\n"
+           "    -d   -o debug              enable debug output (implies -f)\n"
+           "    -f                         foreground operation\n"
+           "    -o max_idle_threads        the maximum number of idle worker "
+           "threads\n"
+           "                               allowed (default: 10)\n");
 }
 
 static int fuse_helper_opt_proc(void *data, const char *arg, int key,