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.
阅读(88) | 评论(0) | 转发(0) |
--- libvirt-glib/libvirt-glib-event.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libvirt-glib/libvirt-glib-event.c b/libvirt-glib/libvirt-glib-event.c index 94f4de8..c3eb3c8 100644 --- a/libvirt-glib/libvirt-glib-event.c +++ b/libvirt-glib/libvirt-glib-event.c
@@ -384,7 +384,7 @@
gvir_event_timeout_update(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,
-- 1.7.8.5
https://bugzilla.redhat.com/show_bug.cgi?id=819617https://www.redhat.com/archives/libvir-list/2012-May/msg01157.htmlhttp://www.redhat.com/archives/libvir-list/2012-June/msg00445.html
https://bugzilla.redhat.com/show_bug.cgi?id=819617https://www.redhat.com/archives/libvir-list/2012-May/msg01157.htmlhttp://www.redhat.com/archives/libvir-list/2012-June/msg00445.html
相关热门文章
给主人留下些什么吧!~~
评论热议
本文讨论了Libvirt中定时器的问题,特别是当定时器被禁用(timeout=-1)时无法随机启动的问题(timeout=0)。文中提到了在glib主循环中的映射问题导致的困扰,并附带了libvirt-glib-event.c文件的代码变更记录。
804

被折叠的 条评论
为什么被折叠?



