migration/multifd: Cleanup multifd_save_cleanup()
authorPeter Xu <peterx@redhat.com>
Fri, 2 Feb 2024 10:28:53 +0000 (18:28 +0800)
committerPeter Xu <peterx@redhat.com>
Mon, 5 Feb 2024 06:42:10 +0000 (14:42 +0800)
commit12808db3b8c22d26c9bc3da6f41756890ce882e4
treea8c06ef8e2604448bfdea75598b497fe8c338a34
parentf88f86c4ee3fe673b34873e27af2de0a16fe01fd
migration/multifd: Cleanup multifd_save_cleanup()

Shrink the function by moving relevant works into helpers: move the thread
join()s into multifd_send_terminate_threads(), then create two more helpers
to cover channel/state cleanups.

Add a TODO entry for the thread terminate process because p->running is
still buggy.  We need to fix it at some point but not yet covered.

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