|
@@ -39,13 +39,6 @@ DECLARE_CLASS_CHECKERS(IOThreadClass, IOTHREAD,
|
|
#define IOTHREAD_POLL_MAX_NS_DEFAULT 0ULL
|
|
#define IOTHREAD_POLL_MAX_NS_DEFAULT 0ULL
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-static __thread IOThread *my_iothread;
|
|
|
|
-
|
|
|
|
-AioContext *qemu_get_current_aio_context(void)
|
|
|
|
-{
|
|
|
|
- return my_iothread ? my_iothread->ctx : qemu_get_aio_context();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void *iothread_run(void *opaque)
|
|
static void *iothread_run(void *opaque)
|
|
{
|
|
{
|
|
IOThread *iothread = opaque;
|
|
IOThread *iothread = opaque;
|
|
@@ -56,7 +49,7 @@ static void *iothread_run(void *opaque)
|
|
* in this new thread uses glib.
|
|
* in this new thread uses glib.
|
|
*/
|
|
*/
|
|
g_main_context_push_thread_default(iothread->worker_context);
|
|
g_main_context_push_thread_default(iothread->worker_context);
|
|
- my_iothread = iothread;
|
|
|
|
|
|
+ qemu_set_current_aio_context(iothread->ctx);
|
|
iothread->thread_id = qemu_get_thread_id();
|
|
iothread->thread_id = qemu_get_thread_id();
|
|
qemu_sem_post(&iothread->init_done_sem);
|
|
qemu_sem_post(&iothread->init_done_sem);
|
|
|
|
|