[virt-tools-list] [virt-viewer][PATCH 6/6] events: Allow zero timeouts for timer

Christophe Fergeau cfergeau at redhat.com
Fri Jul 17 16:39:02 UTC 2015


ACK, though this one comes much sooner in libvirt-glib history.

Christophe

On Fri, Jul 17, 2015 at 04:01:23PM +0200, Fabiano Fidêncio wrote:
> 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
> http://libvirt.org/git/?p=libvirt-glib.git;a=commit;h=a40a1732e0d53fcc44b8d348cec97152dafd2b88
> 
> 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 c6442f6..d36dd3a 100644
> --- a/src/virt-viewer-events.c
> +++ b/src/virt-viewer-events.c
> @@ -355,7 +355,7 @@ virt_viewer_events_update_timeout(int timer,
>  
>      if (interval >= 0) {
>          if (data->source != 0)
> -            goto cleanup;
> +            g_source_remove(data->source);
>  
>          data->interval = interval;
>          data->source = g_timeout_add(data->interval,
> -- 
> 2.4.4
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20150717/8fb21a4b/attachment.sig>


More information about the virt-tools-list mailing list