replay: rewrite async event handling

This patch decouples checkpoints and async events.
It was a tricky part of replay implementation. Now it becomes
much simpler and easier to maintain.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <165364837856.688121.8785039478408995979.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Pavel Dovgalyuk 2022-05-27 13:46:18 +03:00 committed by Paolo Bonzini
parent 75bbe5e5ec
commit 60618e2d77
8 changed files with 54 additions and 76 deletions

View file

@ -160,9 +160,14 @@ void replay_shutdown_request(ShutdownCause cause);
Returns 0 in PLAY mode if checkpoint was not found.
Returns 1 in all other cases. */
bool replay_checkpoint(ReplayCheckpoint checkpoint);
/*! Used to determine that checkpoint is pending.
/*! Used to determine that checkpoint or async event is pending.
Does not proceed to the next event in the log. */
bool replay_has_checkpoint(void);
bool replay_has_event(void);
/*
* Processes the async events added to the queue (while recording)
* or reads the events from the file (while replaying).
*/
void replay_async_events(void);
/* Asynchronous events queue */