From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBhEI-0004My-Ef for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:05:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBhEE-00046x-Vx for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:05:14 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:57325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBhEE-00046j-LR for qemu-devel@nongnu.org; Wed, 23 Dec 2015 06:05:10 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 Dec 2015 11:05:09 -0000 From: Greg Kurz Date: Wed, 23 Dec 2015 12:04:36 +0100 Message-Id: <1450868676-13118-2-git-send-email-gkurz@linux.vnet.ibm.com> In-Reply-To: <1450868676-13118-1-git-send-email-gkurz@linux.vnet.ibm.com> References: <1450868676-13118-1-git-send-email-gkurz@linux.vnet.ibm.com> Subject: [Qemu-devel] [PULL] virtio-9p: use accessor to get thread_pool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-stable@nongnu.org, Michael Tokarev , "Aneesh Kumar K.V" , Greg Kurz The aio_context_new() function does not allocate a thread pool. This is deferred to the first call to the aio_get_thread_pool() accessor. It is hence forbidden to access the thread_pool field directly, as it may be NULL. The accessor *must* be used always. Fixes: ebac1202c95a4f1b76b6ef3f0f63926fa76e753e Reviewed-by: Michael Tokarev Tested-by: Michael Tokarev Cc: qemu-stable@nongnu.org Signed-off-by: Greg Kurz --- hw/9pfs/virtio-9p-coth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/virtio-9p-coth.c b/hw/9pfs/virtio-9p-coth.c index fb6e8f80e0f4..ab9425c60fd2 100644 --- a/hw/9pfs/virtio-9p-coth.c +++ b/hw/9pfs/virtio-9p-coth.c @@ -36,6 +36,6 @@ static int coroutine_enter_func(void *arg) void co_run_in_worker_bh(void *opaque) { Coroutine *co = opaque; - thread_pool_submit_aio(qemu_get_aio_context()->thread_pool, + thread_pool_submit_aio(aio_get_thread_pool(qemu_get_aio_context()), coroutine_enter_func, co, coroutine_enter_cb, co); } -- 2.4.3