@@ -17,6 +17,7 @@ int multifd_save_setup(Error **errp);
void multifd_save_cleanup(void);
int multifd_load_setup(Error **errp);
void multifd_load_cleanup(void);
+void multifd_load_shutdown(void);
bool multifd_recv_all_channels_created(void);
void multifd_recv_new_channel(QIOChannel *ioc, Error **errp);
void multifd_recv_sync_main(void);
@@ -315,6 +315,8 @@ void migration_incoming_state_destroy(void)
{
struct MigrationIncomingState *mis = migration_incoming_get_current();
+ multifd_load_cleanup();
+
if (mis->to_src_file) {
/* Tell source that we are done */
migrate_send_rp_shut(mis, qemu_file_get_error(mis->from_src_file) != 0);
@@ -559,7 +561,7 @@ static void process_incoming_migration_bh(void *opaque)
*/
qemu_announce_self(&mis->announce_timer, migrate_announce_params());
- multifd_load_cleanup();
+ multifd_load_shutdown();
dirty_bitmap_mig_before_vm_start();
@@ -1013,6 +1013,13 @@ static void multifd_recv_terminate_threads(Error *err)
}
}
+void multifd_load_shutdown(void)
+{
+ if (migrate_use_multifd()) {
+ multifd_recv_terminate_threads(NULL);
+ }
+}
+
void multifd_load_cleanup(void)
{
int i;