Migration/colo.c: Add the necessary checks for colo_do_failover

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Zhang Chen 2019-03-22 18:13:32 +08:00 committed by Juan Quintela
parent 3a43ac4757
commit 82cd368ccd
1 changed files with 8 additions and 2 deletions

View File

@ -197,10 +197,16 @@ void colo_do_failover(MigrationState *s)
vm_stop_force_state(RUN_STATE_COLO);
}
if (get_colo_mode() == COLO_MODE_PRIMARY) {
switch (get_colo_mode()) {
case COLO_MODE_PRIMARY:
primary_vm_do_failover();
} else {
break;
case COLO_MODE_SECONDARY:
secondary_vm_do_failover();
break;
default:
error_report("colo_do_failover failed because the colo mode"
" could not be obtained");
}
}