From 951b3120dbc971f08681e1d860360e4a1e638902 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 1 Aug 2019 17:54:09 +0100 Subject: virtiofsd: add --thread-pool-size=NUM option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option to control the size of the thread pool. Requests are now processed in parallel by default. Signed-off-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/virtiofsd/fuse_virtio.c') diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index 0dcf2ef57a..9f6582343c 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -572,10 +572,11 @@ static void *fv_queue_thread(void *opaque) struct fv_QueueInfo *qi = opaque; struct VuDev *dev = &qi->virtio_dev->dev; struct VuVirtq *q = vu_get_queue(dev, qi->qidx); + struct fuse_session *se = qi->virtio_dev->se; GThreadPool *pool; - pool = g_thread_pool_new(fv_queue_worker, qi, 1 /* TODO max_threads */, - TRUE, NULL); + pool = g_thread_pool_new(fv_queue_worker, qi, se->thread_pool_size, TRUE, + NULL); if (!pool) { fuse_log(FUSE_LOG_ERR, "%s: g_thread_pool_new failed\n", __func__); return NULL; -- cgit v1.2.3