diff mbox series

[3/5] crypto: drop gnutls debug logging support

Message ID 20240722131611.2820041-4-berrange@redhat.com (mailing list archive)
State New, archived
Headers show
Series crypto: improve error reporting detail | expand

Commit Message

Daniel P. Berrangé July 22, 2024, 1:16 p.m. UTC
GNUTLS already supports dynamically enabling its logging at runtime by
setting the env var 'GNUTLS_DEBUG_LEVEL=10', so there is no need to
re-invent this logic in QEMU in a way that requires a re-compile.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 crypto/init.c | 11 -----------
 1 file changed, 11 deletions(-)

Comments

Philippe Mathieu-Daudé July 22, 2024, 2:32 p.m. UTC | #1
On 22/7/24 15:16, Daniel P. Berrangé wrote:
> GNUTLS already supports dynamically enabling its logging at runtime by
> setting the env var 'GNUTLS_DEBUG_LEVEL=10', so there is no need to
> re-invent this logic in QEMU in a way that requires a re-compile.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   crypto/init.c | 11 -----------
>   1 file changed, 11 deletions(-)
> 
> diff --git a/crypto/init.c b/crypto/init.c
> index fb7f1bff10..2d6dfa3091 100644
> --- a/crypto/init.c
> +++ b/crypto/init.c
> @@ -34,13 +34,6 @@
>   
>   #include "crypto/random.h"
>   
> -/* #define DEBUG_GNUTLS */

Maybe mention GNUTLS_DEBUG_LEVEL=10 here or in header? Otherwise

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Daniel P. Berrangé July 22, 2024, 3:03 p.m. UTC | #2
On Mon, Jul 22, 2024 at 04:32:23PM +0200, Philippe Mathieu-Daudé wrote:
> On 22/7/24 15:16, Daniel P. Berrangé wrote:
> > GNUTLS already supports dynamically enabling its logging at runtime by
> > setting the env var 'GNUTLS_DEBUG_LEVEL=10', so there is no need to
> > re-invent this logic in QEMU in a way that requires a re-compile.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >   crypto/init.c | 11 -----------
> >   1 file changed, 11 deletions(-)
> > 
> > diff --git a/crypto/init.c b/crypto/init.c
> > index fb7f1bff10..2d6dfa3091 100644
> > --- a/crypto/init.c
> > +++ b/crypto/init.c
> > @@ -34,13 +34,6 @@
> >   #include "crypto/random.h"
> > -/* #define DEBUG_GNUTLS */
> 
> Maybe mention GNUTLS_DEBUG_LEVEL=10 here or in header? Otherwise

I'm adding

/*
 * To debug GNUTLS see env vars listed in
 * https://gnutls.org/manual/html_node/Debugging-and-auditing.html
 */



> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 

With regards,
Daniel
diff mbox series

Patch

diff --git a/crypto/init.c b/crypto/init.c
index fb7f1bff10..2d6dfa3091 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -34,13 +34,6 @@ 
 
 #include "crypto/random.h"
 
-/* #define DEBUG_GNUTLS */
-#ifdef DEBUG_GNUTLS
-static void qcrypto_gnutls_log(int level, const char *str)
-{
-    fprintf(stderr, "%d: %s", level, str);
-}
-#endif
 
 int qcrypto_init(Error **errp)
 {
@@ -53,10 +46,6 @@  int qcrypto_init(Error **errp)
                    gnutls_strerror(ret));
         return -1;
     }
-#ifdef DEBUG_GNUTLS
-    gnutls_global_set_log_level(10);
-    gnutls_global_set_log_function(qcrypto_gnutls_log);
-#endif
 #endif
 
 #ifdef CONFIG_GCRYPT