]> xenbits.xensource.com Git - qemu-xen.git/commit
migration/multifd: Cleanup TLS iochannel referencing
authorPeter Xu <peterx@redhat.com>
Thu, 22 Feb 2024 09:52:57 +0000 (17:52 +0800)
committerPeter Xu <peterx@redhat.com>
Wed, 28 Feb 2024 03:31:28 +0000 (11:31 +0800)
commit9221e3c6a237da90ac296adfeb6e99ea9babfc20
tree6c9ea5494aa43f8ac8771887106708aaa3799922
parentd13f0026c7a625a5a34a5dea4095a4d9cfa04652
migration/multifd: Cleanup TLS iochannel referencing

Commit a1af605bd5 ("migration/multifd: fix hangup with TLS-Multifd due to
blocking handshake") introduced a thread for TLS channels, which will
resolve the issue on blocking the main thread.  However in the same commit
p->c is slightly abused just to be able to pass over the pointer "p" into
the thread.

That's the major reason we'll need to conditionally free the io channel in
the fault paths.

To clean it up, using a separate structure to pass over both "p" and "tioc"
in the tls handshake thread.  Then we can make it a rule that p->c will
never be set until the channel is completely setup.  With that, we can drop
the tricky conditional unref of the io channel in the error path.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240222095301.171137-2-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/multifd.c