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:
parent
3a43ac4757
commit
82cd368ccd
@ -197,10 +197,16 @@ void colo_do_failover(MigrationState *s)
|
|||||||
vm_stop_force_state(RUN_STATE_COLO);
|
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();
|
primary_vm_do_failover();
|
||||||
} else {
|
break;
|
||||||
|
case COLO_MODE_SECONDARY:
|
||||||
secondary_vm_do_failover();
|
secondary_vm_do_failover();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
error_report("colo_do_failover failed because the colo mode"
|
||||||
|
" could not be obtained");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user