[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 29/30] virtiofsd: add --print-capabilities option
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH 29/30] virtiofsd: add --print-capabilities option |
Date: |
Mon, 21 Oct 2019 11:58:31 +0100 |
From: Stefan Hajnoczi <address@hidden>
Add the --print-capabilities option as per vhost-user.rst "Backend
programs conventions". Currently there are no advertised features.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
---
contrib/virtiofsd/fuse_lowlevel.h | 1 +
contrib/virtiofsd/helper.c | 2 ++
contrib/virtiofsd/passthrough_ll.c | 12 ++++++++++++
docs/interop/vhost-user.json | 4 +++-
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/contrib/virtiofsd/fuse_lowlevel.h
b/contrib/virtiofsd/fuse_lowlevel.h
index b06ab6915a..ab964a6fb3 100644
--- a/contrib/virtiofsd/fuse_lowlevel.h
+++ b/contrib/virtiofsd/fuse_lowlevel.h
@@ -1796,6 +1796,7 @@ struct fuse_cmdline_opts {
int nodefault_subtype;
int show_version;
int show_help;
+ int print_capabilities;
int clone_fd;
unsigned int max_idle_threads;
};
diff --git a/contrib/virtiofsd/helper.c b/contrib/virtiofsd/helper.c
index ab20810c28..08e00c0d13 100644
--- a/contrib/virtiofsd/helper.c
+++ b/contrib/virtiofsd/helper.c
@@ -35,6 +35,7 @@ static const struct fuse_opt fuse_helper_opts[] = {
FUSE_HELPER_OPT("--help", show_help),
FUSE_HELPER_OPT("-V", show_version),
FUSE_HELPER_OPT("--version", show_version),
+ FUSE_HELPER_OPT("--print-capabilities", print_capabilities),
FUSE_HELPER_OPT("-d", debug),
FUSE_HELPER_OPT("debug", debug),
FUSE_HELPER_OPT("-d", foreground),
@@ -132,6 +133,7 @@ void fuse_cmdline_help(void)
{
printf(" -h --help print help\n"
" -V --version print version\n"
+ " --print-capabilities print vhost-user.json\n"
" -d -o debug enable debug output (implies
-f)\n"
" -f foreground operation\n"
" --daemonize run in background\n"
diff --git a/contrib/virtiofsd/passthrough_ll.c
b/contrib/virtiofsd/passthrough_ll.c
index c09fc4a65c..2a1a880224 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -1216,6 +1216,14 @@ static struct fuse_lowlevel_ops lo_oper = {
#endif
};
+/* Print vhost-user.json backend program capabilities */
+static void print_capabilities(void)
+{
+ printf("{\n");
+ printf(" \"type\": \"fs\"\n");
+ printf("}\n");
+}
+
int main(int argc, char *argv[])
{
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
@@ -1246,6 +1254,10 @@ int main(int argc, char *argv[])
fuse_lowlevel_version();
ret = 0;
goto err_out1;
+ } else if (opts.print_capabilities) {
+ print_capabilities();
+ ret = 0;
+ goto err_out1;
}
if (fuse_opt_parse(&args, &lo, lo_opts, NULL)== -1)
diff --git a/docs/interop/vhost-user.json b/docs/interop/vhost-user.json
index da6aaf51c8..d4ea1f7ac5 100644
--- a/docs/interop/vhost-user.json
+++ b/docs/interop/vhost-user.json
@@ -31,6 +31,7 @@
# @rproc-serial: virtio remoteproc serial link
# @scsi: virtio scsi
# @vsock: virtio vsock transport
+# @fs: virtio fs (since 4.2)
#
# Since: 4.0
##
@@ -50,7 +51,8 @@
'rpmsg',
'rproc-serial',
'scsi',
- 'vsock'
+ 'vsock',
+ 'fs'
]
}
--
2.23.0
- [PATCH 18/30] virtiofsd: get/set features callbacks, (continued)
- [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), 2019/10/21
- [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) <=
- [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
- Re: [PATCH 00/30] virtiofs daemon (base), Dr. David Alan Gilbert, 2019/10/21
- Re: [PATCH 00/30] virtiofs daemon (base), Michael S. Tsirkin, 2019/10/24
- Re: [PATCH 00/30] virtiofs daemon (base), Dr. David Alan Gilbert, 2019/10/24
- Re: [PATCH 00/30] virtiofs daemon (base), Daniel P . Berrangé, 2019/10/24
- Re: [PATCH 00/30] virtiofs daemon (base), Dr. David Alan Gilbert, 2019/10/24
- Re: [PATCH 00/30] virtiofs daemon (base), Michael S. Tsirkin, 2019/10/24
- Re: [PATCH 00/30] virtiofs daemon (base), Dr. David Alan Gilbert, 2019/10/24