diff options
| author | Wang Yong | 2017-08-29 09:22:37 +0200 |
|---|---|---|
| committer | Jason Wang | 2017-09-08 03:32:48 +0200 |
| commit | 329163cbe64a615b4edf6c40f2fff8c79dbc8fb4 (patch) | |
| tree | e61eeaf1c0896026a57750ddb83410c5411f7caf /include | |
| parent | net/colo-compare.c: Fix comments and scheme (diff) | |
| download | qemu-329163cbe64a615b4edf6c40f2fff8c79dbc8fb4.tar.gz qemu-329163cbe64a615b4edf6c40f2fff8c79dbc8fb4.tar.xz qemu-329163cbe64a615b4edf6c40f2fff8c79dbc8fb4.zip | |
qemu-iothread: IOThread supports the GMainContext event loop
IOThread uses AioContext event loop and does not run a GMainContext.
Therefore,chardev cannot work in IOThread,such as the chardev is
used for colo-compare packets reception.
This patch makes the IOThread run the GMainContext event loop,
chardev and IOThread can work together.
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Wang Yong <wang.yong155@zte.com.cn>
Signed-off-by: Wang Guang <wang.guang55@zte.com.cn>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sysemu/iothread.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h index e6da1a4087..d2985b30ba 100644 --- a/include/sysemu/iothread.h +++ b/include/sysemu/iothread.h @@ -24,6 +24,9 @@ typedef struct { QemuThread thread; AioContext *ctx; + GMainContext *worker_context; + GMainLoop *main_loop; + GOnce once; QemuMutex init_done_lock; QemuCond init_done_cond; /* is thread initialization done? */ bool stopping; @@ -41,5 +44,6 @@ typedef struct { char *iothread_get_id(IOThread *iothread); AioContext *iothread_get_aio_context(IOThread *iothread); void iothread_stop_all(void); +GMainContext *iothread_get_g_main_context(IOThread *iothread); #endif /* IOTHREAD_H */ |
