[virt-tools-list] [virt-viewer v2 06/13] events: allow zero timeouts for timer
Fabiano Fidêncio
fidencio at redhat.com
Wed Jul 22 08:04:33 UTC 2015
In libvirt, it's perfectly possible and widely used to have disabled
timers (timeout=-1) and fire them up 'randomly' with timeout=0.
However, with current mapping into glib mainloop it's not possible
and causing troubles.
Based on commit a40a1732e0d53fcc44b8d348cec97152dafd2b88 from
libvirt-glib.
Original author: Michal Privoznik <mprivozn at redhat.com>
Related to: rhbz#1243228
---
src/virt-viewer-events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/virt-viewer-events.c b/src/virt-viewer-events.c
index 02b7216..462ce6c 100644
--- a/src/virt-viewer-events.c
+++ b/src/virt-viewer-events.c
@@ -349,7 +349,7 @@ virt_viewer_events_update_timeout(int timer,
if (interval >= 0) {
if (data->source)
- goto cleanup;
+ g_source_remove(data->source);
data->interval = interval;
data->source = g_timeout_add(data->interval,
--
2.4.4
More information about the virt-tools-list
mailing list