net: add debug logs

Helped to debug next patch use-after-free.

Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Oleg Vasilev 2023-07-04 13:10:21 +06:00 committed by Michal Privoznik
parent 6c3ef66cc6
commit 54e59e9135
2 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -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;
}