qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] crypto,io,migration: Add support to gnutls_bye()
@ 2025-02-06 17:58 Fabiano Rosas
  2025-02-06 17:58 ` [RFC PATCH 1/4] crypto: Allow gracefully ending the TLS session Fabiano Rosas
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Fabiano Rosas @ 2025-02-06 17:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu, Maciej S . Szmigiero, Daniel P . Berrangé

Hi,

We've been discussing a way to stop multifd recv threads from getting
an error at the end of migration when the source threads close the
iochannel without ending the TLS session.

The original issue was introduced by commit 1d457daf86
("migration/multifd: Further remove the SYNC on complete") which
altered the synchronization of the source and destination in a manner
that causes the destination to already be waiting at recv() when the
source closes the connection.

One approach would be to issue gnutls_bye() at the source after all
the data has been sent. The destination would then gracefully exit
when it gets EOF.

Aside from stopping the recv thread from seeing an error, this also
creates a contract that all connections should be closed only after
the TLS session is ended. This helps to avoid masking a legitimate
issue where the connection is closed prematurely.

Fabiano Rosas (4):
  crypto: Allow gracefully ending the TLS session
  io: tls: Add qio_channel_tls_bye
  migration/multifd: Terminate the TLS connection
  migration: Check migration error after loadvm

 crypto/tlssession.c         | 40 ++++++++++++++++++
 include/crypto/tlssession.h | 22 ++++++++++
 include/io/channel-tls.h    | 12 ++++++
 io/channel-tls.c            | 84 +++++++++++++++++++++++++++++++++++++
 io/trace-events             |  5 +++
 migration/multifd.c         | 34 ++++++++++++++-
 migration/savevm.c          |  6 ++-
 migration/tls.c             |  5 +++
 migration/tls.h             |  2 +-
 9 files changed, 207 insertions(+), 3 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-06 21:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 17:58 [RFC PATCH 0/4] crypto,io,migration: Add support to gnutls_bye() Fabiano Rosas
2025-02-06 17:58 ` [RFC PATCH 1/4] crypto: Allow gracefully ending the TLS session Fabiano Rosas
2025-02-06 18:15   ` Daniel P. Berrangé
2025-02-06 17:58 ` [RFC PATCH 2/4] io: tls: Add qio_channel_tls_bye Fabiano Rosas
2025-02-06 17:58 ` [RFC PATCH 3/4] migration/multifd: Terminate the TLS connection Fabiano Rosas
2025-02-06 17:58 ` [RFC PATCH 4/4] migration: Check migration error after loadvm Fabiano Rosas
2025-02-06 21:08 ` [RFC PATCH 0/4] crypto,io,migration: Add support to gnutls_bye() Maciej S. Szmigiero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).