[Libguestfs] [PATCH nbdkit 4/7] server: Allow -D nbdkit.* debug flags for the core server.

Richard W.M. Jones rjones at redhat.com
Thu Dec 12 12:02:09 UTC 2019


These work like plugin/filter debug flags, but apply to the internals
of the server.
---
 docs/nbdkit.pod    | 7 +++++++
 docs/synopsis.txt  | 2 +-
 server/main.c      | 3 +++
 server/nbdkit.syms | 2 ++
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/docs/nbdkit.pod b/docs/nbdkit.pod
index 656f330..1bacb1d 100644
--- a/docs/nbdkit.pod
+++ b/docs/nbdkit.pod
@@ -177,6 +177,13 @@ Display brief command line usage information and exit.
 Set the plugin or filter Debug Flag called C<FLAG> to the integer
 value C<N>.  See L<nbdkit-plugin(3)/Debug Flags>.
 
+=item B<-D> nbdkit.FLAG=N
+
+=item B<--debug> nbdkit.FLAG=N
+
+Set the nbdkit server Debug Flag called C<FLAG> to the integer value
+C<N>.
+
 =item B<--dump-config>
 
 Dump out the compile-time configuration values and exit.
diff --git a/docs/synopsis.txt b/docs/synopsis.txt
index 2a4adca..07b9dcf 100644
--- a/docs/synopsis.txt
+++ b/docs/synopsis.txt
@@ -1,4 +1,4 @@
-nbdkit [-D|--debug PLUGIN|FILTER.FLAG=N]
+nbdkit [-D|--debug PLUGIN|FILTER|nbdkit.FLAG=N]
        [-e|--exportname EXPORTNAME] [--exit-with-parent]
        [--filter FILTER ...] [-f|--foreground]
        [-g|--group GROUP] [-i|--ipaddr IPADDR]
diff --git a/server/main.c b/server/main.c
index 486ff35..ebac3ef 100644
--- a/server/main.c
+++ b/server/main.c
@@ -613,6 +613,9 @@ main (int argc, char *argv[])
     free (t);
   }
 
+  /* Apply nbdkit.* flags for the server. */
+  apply_debug_flags (NULL, "nbdkit");
+
   /* Check all debug flags were used, and free them. */
   free_debug_flags ();
 
diff --git a/server/nbdkit.syms b/server/nbdkit.syms
index 390972e..96c22c0 100644
--- a/server/nbdkit.syms
+++ b/server/nbdkit.syms
@@ -67,6 +67,8 @@
     nbdkit_vdebug;
     nbdkit_verror;
 
+    nbdkit_debug_*;
+
   # Everything else is hidden.
   local: *;
 };
-- 
2.23.0




More information about the Libguestfs mailing list