mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 04:21:50 -06:00
COLO: Remove colo_state migration struct
We need to know if migration is going into COLO state for incoming side before start normal migration. Instead by using the VMStateDescription to send colo_state from source side to destination side, we use MIG_CMD_ENABLE_COLO to indicate whether COLO is enabled or not. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Zhang Chen <zhangckid@gmail.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
8e48ac9586
commit
aad555c229
9 changed files with 57 additions and 83 deletions
|
@ -152,6 +152,17 @@ static void primary_vm_do_failover(void)
|
|||
qemu_sem_post(&s->colo_exit_sem);
|
||||
}
|
||||
|
||||
COLOMode get_colo_mode(void)
|
||||
{
|
||||
if (migration_in_colo_state()) {
|
||||
return COLO_MODE_PRIMARY;
|
||||
} else if (migration_incoming_in_colo_state()) {
|
||||
return COLO_MODE_SECONDARY;
|
||||
} else {
|
||||
return COLO_MODE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
void colo_do_failover(MigrationState *s)
|
||||
{
|
||||
/* Make sure VM stopped while failover happened. */
|
||||
|
@ -746,7 +757,7 @@ out:
|
|||
if (mis->to_src_file) {
|
||||
qemu_fclose(mis->to_src_file);
|
||||
}
|
||||
migration_incoming_exit_colo();
|
||||
migration_incoming_disable_colo();
|
||||
|
||||
rcu_unregister_thread();
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue