|
|
|
@ -97,7 +97,8 @@ static GSList *migration_blockers[MIG_MODE__MAX]; |
|
|
|
|
|
|
|
static bool migration_object_check(MigrationState *ms, Error **errp); |
|
|
|
static bool migration_switchover_start(MigrationState *s, Error **errp); |
|
|
|
static bool close_return_path_on_source(MigrationState *s); |
|
|
|
static bool stop_return_path_thread_on_source(MigrationState *s); |
|
|
|
static void migration_release_dst_files(MigrationState *ms); |
|
|
|
static void migration_completion_end(MigrationState *s); |
|
|
|
|
|
|
|
static void migration_downtime_start(MigrationState *s) |
|
|
|
@ -1281,7 +1282,8 @@ static void migration_cleanup(MigrationState *s) |
|
|
|
cpr_state_close(); |
|
|
|
cpr_transfer_source_destroy(s); |
|
|
|
|
|
|
|
close_return_path_on_source(s); |
|
|
|
stop_return_path_thread_on_source(s); |
|
|
|
migration_release_dst_files(s); |
|
|
|
|
|
|
|
if (s->migration_thread_running) { |
|
|
|
bql_unlock(); |
|
|
|
@ -2217,6 +2219,7 @@ static void migration_release_dst_files(MigrationState *ms) |
|
|
|
* locking needed because this qemufile should only be managed by |
|
|
|
* return path thread. |
|
|
|
*/ |
|
|
|
assert(!ms->rp_state.rp_thread_created); |
|
|
|
if (ms->postcopy_qemufile_src) { |
|
|
|
migration_ioc_unregister_yank_from_file(ms->postcopy_qemufile_src); |
|
|
|
qemu_file_shutdown(ms->postcopy_qemufile_src); |
|
|
|
@ -2224,7 +2227,9 @@ static void migration_release_dst_files(MigrationState *ms) |
|
|
|
ms->postcopy_qemufile_src = NULL; |
|
|
|
} |
|
|
|
|
|
|
|
if (file) { |
|
|
|
qemu_fclose(file); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
@ -2410,7 +2415,7 @@ static void open_return_path_on_source(MigrationState *ms) |
|
|
|
} |
|
|
|
|
|
|
|
/* Return true if error detected, or false otherwise */ |
|
|
|
static bool close_return_path_on_source(MigrationState *ms) |
|
|
|
static bool stop_return_path_thread_on_source(MigrationState *ms) |
|
|
|
{ |
|
|
|
if (!ms->rp_state.rp_thread_created) { |
|
|
|
return false; |
|
|
|
@ -2432,7 +2437,6 @@ static bool close_return_path_on_source(MigrationState *ms) |
|
|
|
|
|
|
|
qemu_thread_join(&ms->rp_state.rp_thread); |
|
|
|
ms->rp_state.rp_thread_created = false; |
|
|
|
migration_release_dst_files(ms); |
|
|
|
trace_migration_return_path_end_after(); |
|
|
|
|
|
|
|
/* Return path will persist the error in MigrationState when quit */ |
|
|
|
@ -2795,7 +2799,7 @@ static void migration_completion(MigrationState *s) |
|
|
|
goto fail; |
|
|
|
} |
|
|
|
|
|
|
|
if (close_return_path_on_source(s)) { |
|
|
|
if (stop_return_path_thread_on_source(s)) { |
|
|
|
goto fail; |
|
|
|
} |
|
|
|
|
|
|
|
@ -2949,7 +2953,8 @@ static MigThrError postcopy_pause(MigrationState *s) |
|
|
|
* path and just wait for the thread to finish. It will be |
|
|
|
* re-created when we resume. |
|
|
|
*/ |
|
|
|
close_return_path_on_source(s); |
|
|
|
stop_return_path_thread_on_source(s); |
|
|
|
migration_release_dst_files(s); |
|
|
|
|
|
|
|
/*
|
|
|
|
* Current channel is possibly broken. Release it. Note that this is |
|
|
|
|