Helped to debug next patch use-after-free.
Signed-off-by: Oleg Vasilev <oleg.vasilev(a)virtuozzo.com>
---
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