From patchwork Wed Dec 23 11:04:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 560451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E2100140C08 for ; Wed, 23 Dec 2015 22:06:14 +1100 (AEDT) Received: from localhost ([::1]:55465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBhFE-0005tH-Je for incoming@patchwork.ozlabs.org; Wed, 23 Dec 2015 06:06:12 -0500 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 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 23 Dec 2015 11:05:07 -0000 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: gkurz@linux.vnet.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org;qemu-stable@nongnu.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 527951B0804B; Wed, 23 Dec 2015 11:05:42 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tBNB56Bt38535342; Wed, 23 Dec 2015 11:05:06 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tBNA57cC017722; Wed, 23 Dec 2015 03:05:08 -0700 Received: from smtp.lab.toulouse-stg.fr.ibm.com (srv01.lab.toulouse-stg.fr.ibm.com [9.101.4.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tBNA57o0017707; Wed, 23 Dec 2015 03:05:07 -0700 Received: from bahia.huguette.org (sig-9-79-56-140.de.ibm.com [9.79.56.140]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 41AD022054F; Wed, 23 Dec 2015 12:05:05 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Wed, 23 Dec 2015 12:04:36 +0100 Message-Id: <1450868676-13118-2-git-send-email-gkurz@linux.vnet.ibm.com> X-Mailer: git-send-email 2.4.3 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> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15122311-0021-0000-0000-000008640313 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.111 Cc: Peter Maydell , qemu-stable@nongnu.org, Michael Tokarev , "Aneesh Kumar K.V" , Greg Kurz Subject: [Qemu-devel] [PULL] virtio-9p: use accessor to get thread_pool X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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); }