Re: [Qemu-devel] [RFC PATCH V7 5/7] qemu-char: Fix context for g_source_attach()

2016-07-18 Thread Daniel P. Berrange
On Mon, Jul 18, 2016 at 03:40:48PM +0800, Zhang Chen wrote: > We want to poll and handle chardev in another thread > other than main loop. But qemu_chr_add_handlers() can only > work for global default context other than thread default context. > So we use g_source_attach(xx, g_main_context_get_thr

[Qemu-devel] [RFC PATCH V7 5/7] qemu-char: Fix context for g_source_attach()

2016-07-18 Thread Zhang Chen
We want to poll and handle chardev in another thread other than main loop. But qemu_chr_add_handlers() can only work for global default context other than thread default context. So we use g_source_attach(xx, g_main_context_get_thread_default()) replace g_source_attach(xx, NULL) to attach g_source.

[Qemu-devel] [RFC PATCH V7 5/7] qemu-char: Fix context for g_source_attach()

2016-07-17 Thread Zhang Chen
We want to poll and handle chardev in another thread other than main loop. But qemu_chr_add_handlers() can only work for global default context other than thread default context. So we use g_source_attach(xx, g_main_context_get_thread_default()) replace g_source_attach(xx, NULL) to attach g_source.