]> xenbits.xensource.com Git - libvirt.git/commitdiff
Don't update timer if there's none.
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 6 Oct 2016 15:05:14 +0000 (17:05 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 10 Oct 2016 09:15:00 +0000 (11:15 +0200)
Sometimes virObjectEventStateFlush can be called without timer (if the
last event was unregistered right when the timer fired).  There is a
check for timer == -1, but that triggers warning and other log messages,
which is unnecessary.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/conf/object_event.c

index b5a6a81a3a044d650fc80d860c76e6bcc3a4792a..e5af4be68a7e9a7b4593cb80f44eae1df028d7f5 100644 (file)
@@ -818,7 +818,8 @@ virObjectEventStateFlush(virObjectEventStatePtr state)
     tempQueue.events = state->queue->events;
     state->queue->count = 0;
     state->queue->events = NULL;
-    virEventUpdateTimeout(state->timer, -1);
+    if (state->timer != -1)
+        virEventUpdateTimeout(state->timer, -1);
 
     virObjectEventStateQueueDispatch(state,
                                      &tempQueue,