From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAc1G-0001FM-2E for qemu-devel@nongnu.org; Sun, 20 Dec 2015 06:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAc1D-0002sI-Ru for qemu-devel@nongnu.org; Sun, 20 Dec 2015 06:19:18 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:44705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAc1D-0002s3-Hk for qemu-devel@nongnu.org; Sun, 20 Dec 2015 06:19:15 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 20 Dec 2015 11:19:12 -0000 From: Greg Kurz Date: Sun, 20 Dec 2015 12:19:05 +0100 Message-ID: <20151220111608.6664.85476.stgit@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] virtio-9p: use accessor to get thread_pool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: qemu-devel@nongnu.org, Paolo Bonzini , Michael Tokarev , qemu-stable@nongnu.org, "Aneesh Kumar K.V" 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 Signed-off-by: Greg Kurz --- Michael, I did not have time to reproduce the issue, and therefore to effectively test this patch fixes it. Maybe you can do it ? Thanks. -- Greg 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); }