peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0001-virtio-9p-use-accessor-to-get-thread-pool.patch

Paolo Bonzini 205399
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
Paolo Bonzini 205399
Subject: [PATCH] virtio-9p: use accessor to get thread_pool
Paolo Bonzini 205399
Date: Sun, 20 Dec 2015 12:19:05 +0100
Paolo Bonzini 205399
Paolo Bonzini 205399
The aio_context_new() function does not allocate a thread pool. This is
Paolo Bonzini 205399
deferred to the first call to the aio_get_thread_pool() accessor. It is
Paolo Bonzini 205399
hence forbidden to access the thread_pool field directly, as it may be
Paolo Bonzini 205399
NULL. The accessor *must* be used always.
Paolo Bonzini 205399
Paolo Bonzini 205399
Fixes: ebac1202c95a4f1b76b6ef3f0f63926fa76e753e
Paolo Bonzini 205399
Cc: qemu-stable@nongnu.org
Paolo Bonzini 205399
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Paolo Bonzini 205399
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Paolo Bonzini 205399
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Paolo Bonzini 205399
Paolo Bonzini 205399
 hw/9pfs/virtio-9p-coth.c |    2 +-
Paolo Bonzini 205399
 1 file changed, 1 insertion(+), 1 deletion(-)
Paolo Bonzini 205399
Paolo Bonzini 205399
diff --git a/hw/9pfs/virtio-9p-coth.c b/hw/9pfs/virtio-9p-coth.c
Paolo Bonzini 205399
index fb6e8f80e0f4..ab9425c60fd2 100644
Paolo Bonzini 205399
--- a/hw/9pfs/virtio-9p-coth.c
Paolo Bonzini 205399
+++ b/hw/9pfs/virtio-9p-coth.c
Paolo Bonzini 205399
@@ -36,6 +36,6 @@ static int coroutine_enter_func(void *arg)
Paolo Bonzini 205399
 void co_run_in_worker_bh(void *opaque)
Paolo Bonzini 205399
 {
Paolo Bonzini 205399
     Coroutine *co = opaque;
Paolo Bonzini 205399
-    thread_pool_submit_aio(qemu_get_aio_context()->thread_pool,
Paolo Bonzini 205399
+    thread_pool_submit_aio(aio_get_thread_pool(qemu_get_aio_context()),
Paolo Bonzini 205399
                            coroutine_enter_func, co, coroutine_enter_cb, co);
Paolo Bonzini 205399
 }
Paolo Bonzini 205399
Paolo Bonzini 205399
Paolo Bonzini 205399
Paolo Bonzini 205399