]> git.proxmox.com Git - mirror_qemu.git/commit
migration/multifd: Split multifd_send_terminate_threads()
authorPeter Xu <peterx@redhat.com>
Fri, 2 Feb 2024 10:28:49 +0000 (18:28 +0800)
committerPeter Xu <peterx@redhat.com>
Mon, 5 Feb 2024 06:42:10 +0000 (14:42 +0800)
commit3ab4441d97af59ea09ee015d68c4770704b2b34f
tree11fe4044245090447f0a56e33b17b9789d210454
parent859ebaf346e8b5dece6cf255c604fe953d8ec9ab
migration/multifd: Split multifd_send_terminate_threads()

Split multifd_send_terminate_threads() into two functions:

  - multifd_send_set_error(): used when an error happened on the sender
    side, set error and quit state only

  - multifd_send_terminate_threads(): used only by the main thread to kick
    all multifd send threads out of sleep, for the last recycling.

Use multifd_send_set_error() in the three old call sites where only the
error will be set.

Use multifd_send_terminate_threads() in the last one where the main thread
will kick the multifd threads at last in multifd_save_cleanup().

Both helpers will need to set quitting=1.

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