From 4fa8ed25b8dc996d92c60fb6b63752593be5f3a4 Mon Sep 17 00:00:00 2001 From: Lukas Straub Date: Mon, 11 May 2020 13:11:01 +0200 Subject: migration/colo.c: Move colo_notify_compares_event to the right place If the secondary has to failover during checkpointing, it still is in the old state (i.e. different state than primary). Thus we can't expose the primary state until after the checkpoint is sent. This fixes sporadic connection reset of client connections during failover. Signed-off-by: Lukas Straub Message-Id: Reviewed-by: zhanghailiang Signed-off-by: Dr. David Alan Gilbert --- migration/colo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'migration') diff --git a/migration/colo.c b/migration/colo.c index 59639f5..ea7d1e9 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -436,12 +436,6 @@ static int colo_do_checkpoint_transaction(MigrationState *s, goto out; } - qemu_event_reset(&s->colo_checkpoint_event); - colo_notify_compares_event(NULL, COLO_EVENT_CHECKPOINT, &local_err); - if (local_err) { - goto out; - } - /* Disable block migration */ migrate_set_block_enabled(false, &local_err); if (local_err) { @@ -503,6 +497,12 @@ static int colo_do_checkpoint_transaction(MigrationState *s, goto out; } + qemu_event_reset(&s->colo_checkpoint_event); + colo_notify_compares_event(NULL, COLO_EVENT_CHECKPOINT, &local_err); + if (local_err) { + goto out; + } + colo_receive_check_message(s->rp_state.from_dst_file, COLO_MESSAGE_VMSTATE_LOADED, &local_err); if (local_err) { -- cgit v1.1