]> git.proxmox.com Git - qemu.git/blobdiff - qemu-timer.c
Avoid asprintf() which is not available on mingw
[qemu.git] / qemu-timer.c
index 062fdf2cb9648381b3b63df6bd51cca578a9f751..5aea94e8e00ffb4ba6e93cfbfd2172e8d82ac787 100644 (file)
@@ -112,14 +112,10 @@ static int64_t qemu_next_alarm_deadline(void)
 
 static void qemu_rearm_alarm_timer(struct qemu_alarm_timer *t)
 {
-    int64_t nearest_delta_ns;
-    if (!rt_clock->active_timers &&
-        !vm_clock->active_timers &&
-        !host_clock->active_timers) {
-        return;
+    int64_t nearest_delta_ns = qemu_next_alarm_deadline();
+    if (nearest_delta_ns < INT64_MAX) {
+        t->rearm(t, nearest_delta_ns);
     }
-    nearest_delta_ns = qemu_next_alarm_deadline();
-    t->rearm(t, nearest_delta_ns);
 }
 
 /* TODO: MIN_TIMER_REARM_NS should be optimized */