qemu-char: really fix behavior on can_read = 0
I misread the glib manual, g_source_remove does not let you re-attach the source later. This behavior (called "blocking" the source in glib) is present in glib's source code, but private and not available outside glib; hence, we have to resort to re-creating the source every time. In fact, g_source_remove and g_source_destroy are the same thing, except g_source_destroy is O(1) while g_source_remove scans a potentially very long list of GSources in the current main loop. Ugh. Better use g_source_destroy explicitly, and leave "tags" to those dummies who cannot track their pointers' lifetimes. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Message-id: 1365426195-12596-1-git-send-email-pbonzini@redhat.com Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
Showing
想要评论请 注册 或 登录