summaryrefslogtreecommitdiff
path: root/qemu-timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-timer.c')
-rw-r--r--qemu-timer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/qemu-timer.c b/qemu-timer.c
index 746ba8b7e1..b56bfde706 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -392,6 +392,22 @@ int64_t qemu_clock_deadline_ns(QEMUClock *clock)
return timerlist_deadline_ns(clock->main_loop_timerlist);
}
+/* Calculate the soonest deadline across all timerlists attached
+ * to the clock. This is used for the icount timeout so we
+ * ignore whether or not the clock should be used in deadline
+ * calculations.
+ */
+int64_t qemu_clock_deadline_ns_all(QEMUClock *clock)
+{
+ int64_t deadline = -1;
+ QEMUTimerList *timer_list;
+ QLIST_FOREACH(timer_list, &clock->timerlists, list) {
+ deadline = qemu_soonest_timeout(deadline,
+ timerlist_deadline_ns(timer_list));
+ }
+ return deadline;
+}
+
QEMUClock *timerlist_get_clock(QEMUTimerList *timer_list)
{
return timer_list->clock;