Example after applying this patch:

  $ ./nbdkit -fv --port 9999 -e foo null 1M
  /home/rjones/d/nbdkit/server/nbdkit -f -v --port=9999 -e foo -- 
/home/rjones/d/nbdkit/plugins/null/.libs/nbdkit-null-plugin.so 1M
  nbdkit: debug: nbdkit 1.35.12
  nbdkit: debug: TLS disabled: could not load TLS certificates
  nbdkit: debug: NBD URI: nbd://localhost:9999/foo

An alternative I considered was adding a --print-uri option which
would print the URI on stdout.  Maybe we could do this as an
alternative later.  Normally the server does not print anything on
stdout, and it is problematic in some modes, like when using -s.
---
 server/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/main.c b/server/main.c
index 54eb348ba..0c9019d94 100644
--- a/server/main.c
+++ b/server/main.c
@@ -637,6 +637,8 @@ main (int argc, char *argv[])
    * Note this may be NULL.
    */
   uri = make_uri ();
+  if (uri)
+    debug ("NBD URI: %s", uri);
 
   /* The remaining command line arguments are the plugin name and
    * parameters.  If --help, --version or --dump-plugin were specified
-- 
2.41.0

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to