On Fri, Feb 07, 2025 at 11:27:51AM -0300, Fabiano Rosas wrote: > QEMU's TLS session code provides no way to call gnutls_bye() to > terminate a TLS session. Callers of qcrypto_tls_session_read() can > choose to ignore a GNUTLS_E_PREMATURE_TERMINATION error by setting the > gracefulTermination argument. > > The QIOChannelTLS ignores the premature termination error whenever > shutdown() has already been issued. This is not enough anymore for the > migration code due to changes [1] in the synchronization between > migration source and destination.
This sentence seems to say commit [1] changed something on the tls condition, but IMHO fundamentally the issue is multifd recv thread model that relies on blocking readv() rather than request-based (like what src multifd does). Now src uses either shutdown() or close() to kick dest multifd recv threads out from readv(). That has nothing to do with what we do during complete() with those sync messages.. referencing it is ok, but we'll need to reference also the other commit to be clear pre-9.0 can also be prone to this. To me, it's more important to mention the root cause on the multifd recv thread model, which requires explicit tls terminations. > > Add support for calling gnutls_bye() in the tlssession layer so users > of QIOChannelTLS can clearly identify the end of a TLS session. > > 1- 1d457daf86 ("migration/multifd: Further remove the SYNC on complete") > > Signed-off-by: Fabiano Rosas <faro...@suse.de> -- Peter Xu