/* failover */
void colo_do_failover(void);
-void colo_checkpoint_notify(void *opaque);
+/*
+ * colo_checkpoint_delay_set
+ *
+ * Handles change of x-checkpoint-delay migration parameter, called from
+ * migrate_params_apply() to notify COLO module about the change.
+ */
+void colo_checkpoint_delay_set(void);
+
void colo_shutdown(void);
#endif
return runstate_check(RUN_STATE_COLO) || !runstate_is_running();
}
+static void colo_checkpoint_notify(void *opaque)
+{
+ MigrationState *s = opaque;
+ int64_t next_notify_time;
+
+ qemu_event_set(&s->colo_checkpoint_event);
+ s->colo_checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
+ next_notify_time = s->colo_checkpoint_time + migrate_checkpoint_delay();
+ timer_mod(s->colo_delay_timer, next_notify_time);
+}
+
+void colo_checkpoint_delay_set(void)
+{
+ if (migration_in_colo_state()) {
+ colo_checkpoint_notify(migrate_get_current());
+ }
+}
+
static void secondary_vm_do_failover(void)
{
/* COLO needs enable block-replication */
}
}
-void colo_checkpoint_notify(void *opaque)
-{
- MigrationState *s = opaque;
- int64_t next_notify_time;
-
- qemu_event_set(&s->colo_checkpoint_event);
- s->colo_checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
- next_notify_time = s->colo_checkpoint_time + migrate_checkpoint_delay();
- timer_mod(s->colo_delay_timer, next_notify_time);
-}
-
void migrate_start_colo_process(MigrationState *s)
{
qemu_mutex_unlock_iothread();
if (params->has_x_checkpoint_delay) {
s->parameters.x_checkpoint_delay = params->x_checkpoint_delay;
- if (migration_in_colo_state()) {
- colo_checkpoint_notify(s);
- }
+ colo_checkpoint_delay_set();
}
if (params->has_block_incremental) {