]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Skip deleted timers when calculting next timeout
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 22 Nov 2012 16:43:57 +0000 (16:43 +0000)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:34:58 +0000 (16:34 -0500)
It is possible for there to be deleted timers when we
calculate the next timeout, and they must be skipped.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit afbd96678e40449ae72cb326a98f9123e53e4aa3)

src/util/event_poll.c

index aab62449eca2c75f7e564c007fc2ce2ddc9f07df..25a5fb4d37d963a99b51c272f5da21e0f387f5ee 100644 (file)
@@ -332,6 +332,8 @@ static int virEventPollCalculateTimeout(int *timeout) {
     EVENT_DEBUG("Calculate expiry of %zu timers", eventLoop.timeoutsCount);
     /* Figure out if we need a timeout */
     for (i = 0 ; i < eventLoop.timeoutsCount ; i++) {
+        if (eventLoop.timeouts[i].deleted)
+            continue;
         if (eventLoop.timeouts[i].frequency < 0)
             continue;