From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
kwolf@redhat.com, hreitz@redhat.com, vsementsov@virtuozzo.com,
jsnow@redhat.com, richard.henderson@linaro.org,
Stefano Garzarella <sgarzare@redhat.com>
Subject: [PULL v2 02/15] block/aio_task: assert `max_busy_tasks` is greater than 0
Date: Thu, 7 Oct 2021 17:39:02 +0200 [thread overview]
Message-ID: <20211007153904.445009-3-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20211007153904.445009-1-vsementsov@virtuozzo.com>
From: Stefano Garzarella <sgarzare@redhat.com>
All code in block/aio_task.c expects `max_busy_tasks` to always
be greater than 0.
Assert this condition during the AioTaskPool creation where
`max_busy_tasks` is set.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211005161157.282396-3-sgarzare@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block/aio_task.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/aio_task.c b/block/aio_task.c
index 88989fa248..9bd17ea2c1 100644
--- a/block/aio_task.c
+++ b/block/aio_task.c
@@ -98,6 +98,8 @@ AioTaskPool *coroutine_fn aio_task_pool_new(int max_busy_tasks)
{
AioTaskPool *pool = g_new0(AioTaskPool, 1);
+ assert(max_busy_tasks > 0);
+
pool->main_co = qemu_coroutine_self();
pool->max_busy_tasks = max_busy_tasks;
--
2.31.1
next prev parent reply other threads:[~2021-10-07 15:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 15:39 [PULL v2 00/15] jobs: mirror: Handle errors after READY cancel Vladimir Sementsov-Ogievskiy
2021-10-07 15:39 ` [PULL v2 01/15] block/backup: avoid integer overflow of `max-workers` Vladimir Sementsov-Ogievskiy
2021-10-07 15:39 ` Vladimir Sementsov-Ogievskiy [this message]
2021-10-07 15:39 ` [PULL v2 09/15] job: Do not soft-cancel after a job is done Vladimir Sementsov-Ogievskiy
2021-10-07 15:39 ` [PULL v2 10/15] job: Add job_cancel_requested() Vladimir Sementsov-Ogievskiy
2021-10-07 19:06 ` [PULL v2 00/15] jobs: mirror: Handle errors after READY cancel Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211007153904.445009-3-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.