Skip to content

Commit

Permalink
replay: check other timers for icount limit
Browse files Browse the repository at this point in the history
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 <[email protected]>
Message-Id: <157675958855.14346.18049977447896411847.stgit@pasha-Precision-3630-Tower>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
Dovgalyuk authored and bonzini committed Jan 7, 2020
1 parent 3817261 commit fc6b2db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc6b2db

Please sign in to comment.