void qmp_x_colo_lost_heartbeat(Error **errp) { if (get_colo_mode() == COLO_MODE_UNKNOWN) { error_setg(errp, QERR_FEATURE_DISABLED, "colo"); return; } failover_request_active(errp); }
void colo_do_failover(MigrationState *s) { /* Make sure VM stopped while failover happened. */ if (!colo_runstate_is_stopped()) { vm_stop_force_state(RUN_STATE_COLO); } if (get_colo_mode() == COLO_MODE_PRIMARY) { primary_vm_do_failover(); } else { secondary_vm_do_failover(); } }
COLOStatus *qmp_query_colo_status(Error **errp) { COLOStatus *s = g_new0(COLOStatus, 1); s->mode = get_colo_mode(); switch (failover_get_state()) { case FAILOVER_STATUS_NONE: s->reason = COLO_EXIT_REASON_NONE; break; case FAILOVER_STATUS_REQUIRE: s->reason = COLO_EXIT_REASON_REQUEST; break; default: s->reason = COLO_EXIT_REASON_ERROR; } return s; }