ivshmem: Implement shm=... with a memory backend
[qemu/kevin.git] / hw / 9pfs / coth.c
blob464293ef2e28082ea8674cec9f695eb614aff1da
1 /*
2 * 9p backend
4 * Copyright IBM, Corp. 2010
6 * Authors:
7 * Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
8 * Venkateswararao Jujjuri(JV) <jvrao@linux.vnet.ibm.com>
10 * This work is licensed under the terms of the GNU GPL, version 2. See
11 * the COPYING file in the top-level directory.
15 #include "qemu/osdep.h"
16 #include "qemu-common.h"
17 #include "block/thread-pool.h"
18 #include "qemu/coroutine.h"
19 #include "qemu/main-loop.h"
20 #include "coth.h"
22 /* Called from QEMU I/O thread. */
23 static void coroutine_enter_cb(void *opaque, int ret)
25 Coroutine *co = opaque;
26 qemu_coroutine_enter(co, NULL);
29 /* Called from worker thread. */
30 static int coroutine_enter_func(void *arg)
32 Coroutine *co = arg;
33 qemu_coroutine_enter(co, NULL);
34 return 0;
37 void co_run_in_worker_bh(void *opaque)
39 Coroutine *co = opaque;
40 thread_pool_submit_aio(aio_get_thread_pool(qemu_get_aio_context()),
41 coroutine_enter_func, co, coroutine_enter_cb, co);