Skip to content

Commit

Permalink
replay: don't process events at virtual clock checkpoint
Browse files Browse the repository at this point in the history
As QEMU becomes more multi-threaded and non-synchronized, checkpoints
move from thread to thread. And the event queue that processed at checkpoints
should belong to the same thread in both record and replay executions.
This patch disables asynchronous event processing at virtual clock
checkpoint, because it may be invoked in different threads at record and
replay. This patch is temporary fix until the checkpoints are completely
refactored.

Signed-off-by: Pavel Dovgalyuk <[email protected]>
Message-Id: <20181018063345.7433.11678.stgit@pasha-VirtualBox>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
Dovgalyuk authored and bonzini committed Oct 19, 2018
1 parent a8de011 commit ca9759c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions replay/replay-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ void replay_save_events(int checkpoint)
{
g_assert(replay_mutex_locked());
g_assert(checkpoint != CHECKPOINT_CLOCK_WARP_START);
g_assert(checkpoint != CHECKPOINT_CLOCK_VIRTUAL);
while (!QTAILQ_EMPTY(&events_list)) {
Event *event = QTAILQ_FIRST(&events_list);
replay_save_event(event, checkpoint);
Expand Down
9 changes: 8 additions & 1 deletion replay/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,14 @@ bool replay_checkpoint(ReplayCheckpoint checkpoint)
/* This checkpoint belongs to several threads.
Processing events from different threads is
non-deterministic */
if (checkpoint != CHECKPOINT_CLOCK_WARP_START) {
if (checkpoint != CHECKPOINT_CLOCK_WARP_START
/* FIXME: this is temporary fix, other checkpoints
may also be invoked from the different threads someday.
Asynchronous event processing should be refactored
to create additional replay event kind which is
nailed to the one of the threads and which processes
the event queue. */
&& checkpoint != CHECKPOINT_CLOCK_VIRTUAL) {
replay_save_events(checkpoint);
}
res = true;
Expand Down

0 comments on commit ca9759c

Please sign in to comment.