[PATCH 1/2] net: add debug logs

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

 



Helped to debug next patch use-after-free.

Signed-off-by: Oleg Vasilev <oleg.vasilev@xxxxxxxxxxxxx>
---
 src/remote/remote_daemon_stream.c | 4 ++--
 src/rpc/virnetmessage.c           | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/remote/remote_daemon_stream.c b/src/remote/remote_daemon_stream.c
index 3b7519d2cb..38a2b6cceb 100644
--- a/src/remote/remote_daemon_stream.c
+++ b/src/remote/remote_daemon_stream.c
@@ -318,8 +318,8 @@ daemonStreamFilter(virNetServerClient *client,
         msg->header.serial != stream->serial)
         goto cleanup;
 
-    VIR_DEBUG("Incoming client=%p, rx=%p, serial=%u, proc=%d, status=%d",
-              client, stream->rx, msg->header.proc,
+    VIR_DEBUG("Incoming client=%p, rx=%p, msg=%p, serial=%u, proc=%d, status=%d",
+              client, stream->rx, msg, msg->header.proc,
               msg->header.serial, msg->header.status);
 
     virNetMessageQueuePush(&stream->rx, msg);
diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index 50cc335fd6..af0f9cb30b 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -103,6 +103,8 @@ void virNetMessageQueuePush(virNetMessage **queue, virNetMessage *msg)
 {
     virNetMessage *tmp = *queue;
 
+    VIR_DEBUG("queue=%p msg=%p", queue, msg);
+
     if (tmp) {
         while (tmp->next)
             tmp = tmp->next;
@@ -117,10 +119,13 @@ virNetMessage *virNetMessageQueueServe(virNetMessage **queue)
 {
     virNetMessage *tmp = *queue;
 
+    VIR_DEBUG("queue serve start queue=%p *queue=%p", queue, *queue);
+
     if (tmp) {
         *queue = g_steal_pointer(&tmp->next);
     }
 
+    VIR_DEBUG("queue serve end queue=%p *queue=%p", queue, *queue);
     return tmp;
 }
 
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux