File io-add-trace-event-when-cancelling-TLS-h.patch of Package qemu.42505

From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Fri, 5 Jan 2024 15:48:07 +0000
Subject: io: add trace event when cancelling TLS handshake
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 003f15369de4e290a4d2e58292d96c5a506e4ee6)
References: bsc#1250984
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
 io/channel-tls.c | 1 +
 io/trace-events  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/io/channel-tls.c b/io/channel-tls.c
index 021604c6d84e3659686cef730869..421d7489629c682cf987c1e60e1d 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -374,6 +374,7 @@ static int qio_channel_tls_close(QIOChannel *ioc,
     QIOChannelTLS *tioc = QIO_CHANNEL_TLS(ioc);
 
     if (tioc->hs_ioc_tag > 0) {
+        trace_qio_channel_tls_handshake_cancel(ioc);
         g_source_remove(tioc->hs_ioc_tag);
         tioc->hs_ioc_tag = 0;
     }
diff --git a/io/trace-events b/io/trace-events
index d7bc70b96668ca0153fea89913c6..b8f02221fe68e208e5c890c1afdd 100644
--- a/io/trace-events
+++ b/io/trace-events
@@ -40,6 +40,7 @@ qio_channel_tls_handshake_start(void *ioc) "TLS handshake start ioc=%p"
 qio_channel_tls_handshake_pending(void *ioc, int status) "TLS handshake pending ioc=%p status=%d"
 qio_channel_tls_handshake_fail(void *ioc) "TLS handshake fail ioc=%p"
 qio_channel_tls_handshake_complete(void *ioc) "TLS handshake complete ioc=%p"
+qio_channel_tls_handshake_cancel(void *ioc) "TLS handshake cancel ioc=%p"
 qio_channel_tls_credentials_allow(void *ioc) "TLS credentials allow ioc=%p"
 qio_channel_tls_credentials_deny(void *ioc) "TLS credentials deny ioc=%p"
 
openSUSE Build Service is sponsored by