qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

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 <lukasstraub2@web.de>
Message-Id: <d4555dd5146a54518c4d9d4efd996b7c745c6687.1589193382.git.lukasstraub2@web.de>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

authored by

Lukas Straub and committed by
Dr. David Alan Gilbert
4fa8ed25 92c932de

+6 -6
+6 -6
migration/colo.c
··· 436 436 goto out; 437 437 } 438 438 439 - qemu_event_reset(&s->colo_checkpoint_event); 440 - colo_notify_compares_event(NULL, COLO_EVENT_CHECKPOINT, &local_err); 441 - if (local_err) { 442 - goto out; 443 - } 444 - 445 439 /* Disable block migration */ 446 440 migrate_set_block_enabled(false, &local_err); 447 441 if (local_err) { ··· 499 493 500 494 colo_receive_check_message(s->rp_state.from_dst_file, 501 495 COLO_MESSAGE_VMSTATE_RECEIVED, &local_err); 496 + if (local_err) { 497 + goto out; 498 + } 499 + 500 + qemu_event_reset(&s->colo_checkpoint_event); 501 + colo_notify_compares_event(NULL, COLO_EVENT_CHECKPOINT, &local_err); 502 502 if (local_err) { 503 503 goto out; 504 504 }