migration: Add a semaphore to count PONGs

This is mostly useless, but useful for us to know whether the main channel
is correctly established without changing the migration protocol.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Peter Xu 2023-02-08 15:28:12 -05:00 committed by Juan Quintela
parent fc063a7b8a
commit b28fb58227
2 changed files with 9 additions and 0 deletions

View file

@ -276,6 +276,12 @@ struct MigrationState {
*/
bool rp_thread_created;
QemuSemaphore rp_sem;
/*
* We post to this when we got one PONG from dest. So far it's an
* easy way to know the main channel has successfully established
* on dest QEMU.
*/
QemuSemaphore rp_pong_acks;
} rp_state;
double mbps;