Patchwork [RFC,PATCHv8,03/30] aio / timers: Consistent treatment of disabled clocks for deadlines

login
register
mail settings
Submitter Alex Bligh
Date Aug. 8, 2013, 9:42 p.m.
Message ID <1375998147-24292-4-git-send-email-alex@alex.org.uk>
Download mbox | patch
Permalink /patch/265819/
State New
Headers show

Comments

Alex Bligh - Aug. 8, 2013, 9:42 p.m.
Make treatment of disabled clocks consistent in deadline calculation

Signed-off-by: Alex Bligh <alex@alex.org.uk>
---
 qemu-timer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/qemu-timer.c b/qemu-timer.c
index 8f378a9..47b5e4b 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -264,7 +264,7 @@  int64_t qemu_clock_deadline(QEMUClock *clock)
     /* To avoid problems with overflow limit this to 2^32.  */
     int64_t delta = INT32_MAX;
 
-    if (clock->active_timers) {
+    if (clock->enabled && clock->active_timers) {
         delta = clock->active_timers->expire_time - qemu_get_clock_ns(clock);
     }
     if (delta < 0) {