summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Dovgalyuk <pavel.dovgaluk@gmail.com>2019-12-19 15:46:28 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-07 12:08:39 +0100
commitfc6b2dbac1d57fc24420fb8ee25911eb6f1d1fb5 (patch)
tree05837cc9d27ed18acf5cdc45d6bc9ad406e72131
parent3817261eb9e763cb2e71649201c7ec0823858f0c (diff)
replay: check other timers for icount limit
Record/replay can stall when there are no virtual devices that generate events - it just uses all the time for vCPU thread. Therefore main loop has to wait too much for the vCPU thread, because they are synchronized in rr mode. This patch does not let creating too long vCPU executions without interrupting to main loop. It checks realtime timers that always exits to control user input. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <157675958855.14346.18049977447896411847.stgit@pasha-Precision-3630-Tower> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--cpus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpus.c b/cpus.c
index b472378b70..be2d655f37 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1316,6 +1316,10 @@ static int64_t tcg_get_icount_limit(void)
*/
deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
QEMU_TIMER_ATTR_ALL);
+ /* Check realtime timers, because they help with input processing */
+ deadline = qemu_soonest_timeout(deadline,
+ qemu_clock_deadline_ns_all(QEMU_CLOCK_REALTIME,
+ QEMU_TIMER_ATTR_ALL));
/* Maintain prior (possibly buggy) behaviour where if no deadline
* was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more than