Re: [Qemu-devel] [PATCH 2/5] colo-compare: kick compare thread to exit while finalize

2017-02-15 Thread Hailiang Zhang
On 2017/2/16 10:25, Zhang Chen wrote: On 02/15/2017 04:34 PM, zhanghailiang wrote: We should call g_main_loop_quit() to notify colo compare thread to exit, Or it will run in g_main_loop_run() forever. Besides, the finalizing process can't happen in context of colo thread, it is reasonable to

Re: [Qemu-devel] [PATCH 2/5] colo-compare: kick compare thread to exit while finalize

2017-02-15 Thread Jason Wang
On 2017年02月16日 10:25, Zhang Chen wrote: @@ -703,13 +704,11 @@ static void colo_compare_finalize(Object *obj) qemu_chr_fe_deinit(&s->chr_sec_in); qemu_chr_fe_deinit(&s->chr_out); -g_queue_free(&s->conn_list); +g_main_loop_quit(s->compare_loop); +qemu_thread_join(&s->thr

Re: [Qemu-devel] [PATCH 2/5] colo-compare: kick compare thread to exit while finalize

2017-02-15 Thread Zhang Chen
On 02/15/2017 04:34 PM, zhanghailiang wrote: We should call g_main_loop_quit() to notify colo compare thread to exit, Or it will run in g_main_loop_run() forever. Besides, the finalizing process can't happen in context of colo thread, it is reasonable to remove the 'if (qemu_thread_is_self(&s-

[Qemu-devel] [PATCH 2/5] colo-compare: kick compare thread to exit while finalize

2017-02-15 Thread zhanghailiang
We should call g_main_loop_quit() to notify colo compare thread to exit, Or it will run in g_main_loop_run() forever. Besides, the finalizing process can't happen in context of colo thread, it is reasonable to remove the 'if (qemu_thread_is_self(&s->thread))' branch. Signed-off-by: zhanghailiang