qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] replay: synchronize on every virtual timer callback
@ 2020-05-06  8:17 Pavel Dovgalyuk
  2020-05-18 10:58 ` Pavel Dovgalyuk
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Pavel Dovgalyuk @ 2020-05-06  8:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, dovgaluk, pavel.dovgaluk

Sometimes virtual timer callbacks depend on order
of virtual timer processing and warping of virtual clock.
Therefore every callback should be logged to make replay deterministic.
This patch creates a checkpoint before every virtual timer callback.
With these checkpoints virtual timers processing and clock warping
events order is completely deterministic.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 util/qemu-timer.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/util/qemu-timer.c b/util/qemu-timer.c
index d548d3c1ad..47833f338f 100644
--- a/util/qemu-timer.c
+++ b/util/qemu-timer.c
@@ -588,6 +588,11 @@ bool timerlist_run_timers(QEMUTimerList *timer_list)
         qemu_mutex_lock(&timer_list->active_timers_lock);
 
         progress = true;
+        /*
+         * Callback may insert new checkpoints, therefore add new checkpoint
+         * for the virtual timers.
+         */
+        need_replay_checkpoint = timer_list->clock->type == QEMU_CLOCK_VIRTUAL;
     }
     qemu_mutex_unlock(&timer_list->active_timers_lock);
 



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-05-22  6:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-06  8:17 [PATCH] replay: synchronize on every virtual timer callback Pavel Dovgalyuk
2020-05-18 10:58 ` Pavel Dovgalyuk
2020-05-18 11:24 ` Philippe Mathieu-Daudé
2020-05-18 15:56   ` Alex Bennée
2020-05-19  5:56     ` Pavel Dovgalyuk
2020-05-19  8:11       ` Alex Bennée
2020-05-19 10:21         ` Pavel Dovgalyuk
2020-05-19 10:32           ` Alex Bennée
2020-05-19 10:38             ` Pavel Dovgalyuk
2020-05-19 15:42               ` Philippe Mathieu-Daudé
2020-05-20  6:54                 ` Pavel Dovgalyuk
2020-05-20  7:18                   ` Philippe Mathieu-Daudé
2020-05-20 10:46                     ` Pavel Dovgalyuk
2020-05-21 13:22 ` Paolo Bonzini
2020-05-22  6:39   ` Pavel Dovgalyuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).