[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt PATCH] remote: slightly improve debugging of socket selection



The current debug message reports the "mode" after selection has
completed, however, the "mode" value can be changed by the selection
logic. It is thus beneficial to report most values upfront, and only
report newly changed values at the end.

Signed-off-by: Daniel P. Berrangé <berrange redhat com>
---
 src/remote/remote_sockets.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c
index 7c69ed9e7f..478c78edc2 100644
--- a/src/remote/remote_sockets.c
+++ b/src/remote/remote_sockets.c
@@ -145,6 +145,11 @@ remoteGetUNIXSocket(remoteDriverTransport transport,
     g_autofree char *direct_sock_name = NULL;
     g_autofree char *legacy_sock_name = NULL;
 
+    VIR_DEBUG("Choosing remote socket for transport=%s mode=%s driver=%s ro=%d session=%d",
+              remoteDriverTransportTypeToString(transport),
+              remoteDriverModeTypeToString(mode),
+              driver, ro, session);
+
     if (driver)
         direct_daemon = g_strdup_printf("virt%sd", driver);
 
@@ -208,12 +213,9 @@ remoteGetUNIXSocket(remoteDriverTransport transport,
         return NULL;
     }
 
-    VIR_DEBUG("Chosen UNIX sockname=%s daemon=%s "
-              "for mode=%s transport=%s ro=%d session=%d",
+    VIR_DEBUG("Chosen UNIX sockname=%s daemon=%s with mode=%s",
               sock_name, NULLSTR(*daemon),
-              remoteDriverModeTypeToString(mode),
-              remoteDriverTransportTypeToString(transport),
-              ro, session);
+              remoteDriverModeTypeToString(mode));
     return sock_name;
 }
 
-- 
2.26.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]