[Spice-devel] [PATCH spice-server 1/4] spice_timer_queue: don't call timers repeatedly

Yonit Halperin yhalperi at redhat.com
Wed Aug 14 08:26:01 PDT 2013


For channels that don't run as part of the main loop, we use
spice_timer_queue, while for the other channels we use
qemu timers support. The callbacks for setting timers are supplied to
red_channel via SpiceCoreInterface, and their behavior should be
consistent. qemu timers are called only once per each call to
timer_start. This patch assigns the same behaviour to spice_timer_queue.
---
 server/spice_timer_queue.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/server/spice_timer_queue.c b/server/spice_timer_queue.c
index 833ab1d..8f6e9c8 100644
--- a/server/spice_timer_queue.c
+++ b/server/spice_timer_queue.c
@@ -261,9 +261,7 @@ void spice_timer_queue_cb(void)
             break;
         } else {
             timer->func(timer->opaque);
-            if (timer->is_active) {
-                _spice_timer_set(timer, timer->ms, now_ms);
-            }
+            spice_timer_cancel(timer);
         }
     }
 }
-- 
1.8.1.4



More information about the Spice-devel mailing list