Blame SOURCES/0001-server-Allow-D-nbdkit.-debug-flags-for-the-core-serv.patch

efa7a1
From d7836fb0a7131c725e3c02be7e48e99c671637c3 Mon Sep 17 00:00:00 2001
efa7a1
From: "Richard W.M. Jones" <rjones@redhat.com>
efa7a1
Date: Thu, 12 Dec 2019 08:57:15 +0000
efa7a1
Subject: [PATCH] server: Allow -D nbdkit.* debug flags for the core server.
efa7a1
efa7a1
These work like plugin/filter debug flags, but apply to the internals
efa7a1
of the server.
efa7a1
efa7a1
(cherry picked from commit 3b45db234a691f8ff926a6fef583e11c3601f112)
efa7a1
---
efa7a1
 docs/nbdkit.pod    | 7 +++++++
efa7a1
 docs/synopsis.txt  | 2 +-
efa7a1
 server/main.c      | 3 +++
efa7a1
 server/nbdkit.syms | 2 ++
efa7a1
 4 files changed, 13 insertions(+), 1 deletion(-)
efa7a1
efa7a1
diff --git a/docs/nbdkit.pod b/docs/nbdkit.pod
efa7a1
index a2e72b1..346d833 100644
efa7a1
--- a/docs/nbdkit.pod
efa7a1
+++ b/docs/nbdkit.pod
efa7a1
@@ -177,6 +177,13 @@ Display brief command line usage information and exit.
efa7a1
 Set the plugin or filter Debug Flag called C<FLAG> to the integer
efa7a1
 value C<N>.  See L<nbdkit-plugin(3)/Debug Flags>.
efa7a1
 
efa7a1
+=item B<-D> nbdkit.FLAG=N
efa7a1
+
efa7a1
+=item B<--debug> nbdkit.FLAG=N
efa7a1
+
efa7a1
+Set the nbdkit server Debug Flag called C<FLAG> to the integer value
efa7a1
+C<N>.
efa7a1
+
efa7a1
 =item B<--dump-config>
efa7a1
 
efa7a1
 Dump out the compile-time configuration values and exit.
efa7a1
diff --git a/docs/synopsis.txt b/docs/synopsis.txt
efa7a1
index 3c23937..c367542 100644
efa7a1
--- a/docs/synopsis.txt
efa7a1
+++ b/docs/synopsis.txt
efa7a1
@@ -1,4 +1,4 @@
efa7a1
-nbdkit [-D|--debug PLUGIN|FILTER.FLAG=N]
efa7a1
+nbdkit [-D|--debug PLUGIN|FILTER|nbdkit.FLAG=N]
efa7a1
        [-e|--exportname EXPORTNAME] [--exit-with-parent]
efa7a1
        [--filter FILTER ...] [-f|--foreground]
efa7a1
        [-g|--group GROUP] [-i|--ipaddr IPADDR]
efa7a1
diff --git a/server/main.c b/server/main.c
efa7a1
index d39941b..11ba1e6 100644
efa7a1
--- a/server/main.c
efa7a1
+++ b/server/main.c
efa7a1
@@ -563,6 +563,9 @@ main (int argc, char *argv[])
efa7a1
     free (t);
efa7a1
   }
efa7a1
 
efa7a1
+  /* Apply nbdkit.* flags for the server. */
efa7a1
+  apply_debug_flags (NULL, "nbdkit");
efa7a1
+
efa7a1
   /* Check all debug flags were used, and free them. */
efa7a1
   free_debug_flags ();
efa7a1
 
efa7a1
diff --git a/server/nbdkit.syms b/server/nbdkit.syms
efa7a1
index 390972e..96c22c0 100644
efa7a1
--- a/server/nbdkit.syms
efa7a1
+++ b/server/nbdkit.syms
efa7a1
@@ -67,6 +67,8 @@
efa7a1
     nbdkit_vdebug;
efa7a1
     nbdkit_verror;
efa7a1
 
efa7a1
+    nbdkit_debug_*;
efa7a1
+
efa7a1
   # Everything else is hidden.
efa7a1
   local: *;
efa7a1
 };
efa7a1
-- 
efa7a1
2.18.2
efa7a1