mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
COLO: Introduce state to record failover process
When handling failover, COLO processes differently according to the different stage of failover process, here we introduce a global atomic variable to record the status of failover. We add four failover status to indicate the different stage of failover process. You should use the helpers to get and set the value. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amit Shah <amit@amitshah.net>
This commit is contained in:
parent
d89e666e06
commit
aef060850b
5 changed files with 69 additions and 0 deletions
|
@ -232,6 +232,8 @@ static void colo_process_checkpoint(MigrationState *s)
|
|||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
failover_init_state();
|
||||
|
||||
s->rp_state.from_dst_file = qemu_file_get_return_path(s->to_dst_file);
|
||||
if (!s->rp_state.from_dst_file) {
|
||||
error_report("Open QEMUFile from_dst_file failed");
|
||||
|
@ -332,6 +334,8 @@ void *colo_process_incoming_thread(void *opaque)
|
|||
migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
|
||||
MIGRATION_STATUS_COLO);
|
||||
|
||||
failover_init_state();
|
||||
|
||||
mis->to_src_file = qemu_file_get_return_path(mis->from_src_file);
|
||||
if (!mis->to_src_file) {
|
||||
error_report("COLO incoming thread: Open QEMUFile to_src_file failed");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue