Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-17 Thread Zhang Chen
On 07/18/2016 01:31 PM, Jason Wang wrote: On 2016年07月18日 09:55, Zhang Chen wrote: Hi~ All~~ Can you give me some feedback for this patch? We need more comments~~ COLO project depend on this patch to work. Because this patch colo-compare can make handler of qemu_chr_add_handlers() run

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-17 Thread Jason Wang
On 2016年07月18日 09:55, Zhang Chen wrote: Hi~ All~~ Can you give me some feedback for this patch? We need more comments~~ COLO project depend on this patch to work. Because this patch colo-compare can make handler of qemu_chr_add_handlers() run in compare thread, reduce workload of main_lo

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-17 Thread Zhang Chen
Hi~ All~~ Can you give me some feedback for this patch? We need more comments~~ COLO project depend on this patch to work. Because this patch colo-compare can make handler of qemu_chr_add_handlers() run in compare thread, reduce workload of main_loop in network busy situation. This idea fr

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-10 Thread Zhang Chen
On 07/08/2016 10:27 PM, Paolo Bonzini wrote: On 08/07/2016 10:54, Daniel P. Berrange wrote: On Fri, Jul 08, 2016 at 09:48:23AM +0800, Fam Zheng wrote: On Wed, 06/22 18:49, Zhang Chen wrote: We want to poll and handle chardev in another thread other than main loop. But qemu_chr_add_handlers(

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-08 Thread Paolo Bonzini
On 08/07/2016 10:54, Daniel P. Berrange wrote: > On Fri, Jul 08, 2016 at 09:48:23AM +0800, Fam Zheng wrote: >> On Wed, 06/22 18:49, 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

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-08 Thread Daniel P. Berrange
On Fri, Jul 08, 2016 at 09:48:23AM +0800, Fam Zheng wrote: > On Wed, 06/22 18:49, 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 w

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-07 Thread Zhang Chen
On 07/08/2016 09:48 AM, Fam Zheng wrote: On Wed, 06/22 18:49, 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_mai

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-07 Thread Fam Zheng
On Wed, 06/22 18:49, 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_thread_default()) > repl

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-07-07 Thread Zhang Chen
On 06/29/2016 02:46 PM, Zhang Chen wrote: On 06/22/2016 06:49 PM, Zhang Chen wrote: Hi~ Paolo~ Just a ping...no news for a week~ Ping...again... CC Fam This patch about main loop. Thanks Zhang Chen We want to poll and handle chardev in another thread other than main loop. But qemu

Re: [Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-06-28 Thread Zhang Chen
On 06/22/2016 06:49 PM, Zhang Chen wrote: Hi~ Paolo~ Just a ping...no news for a week~ 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_attac

[Qemu-devel] [RFC PATCH V2] qemu-char: Fix context for g_source_attach()

2016-06-22 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.