From: Stefan Hajnoczi <stefanha@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] block: move I/O request processing to block/io.c
Date: Wed, 18 Feb 2015 10:20:17 +0000 [thread overview]
Message-ID: <20150218102017.GB6564@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <54E3687D.3050309@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
On Tue, Feb 17, 2015 at 09:12:45AM -0700, Eric Blake wrote:
> On 02/17/2015 07:39 AM, Stefan Hajnoczi wrote:
> > -void bdrv_drain_all(void)
> > -{
> > - /* Always run first iteration so any pending completion BHs run */
> > - bool busy = true;
> > - BlockDriverState *bs;
> > -
> > - while (busy) {
> > - busy = false;
> > -
> > - QTAILQ_FOREACH(bs, &bdrv_states, device_list) {
> > - AioContext *aio_context = bdrv_get_aio_context(bs);
> > -
>
> > +void bdrv_drain_all(void)
> > +{
> > + /* Always run first iteration so any pending completion BHs run */
> > + bool busy = true;
> > + BlockDriverState *bs = NULL;
> > +
> > + while (busy) {
> > + busy = false;
> > +
> > + while ((bs = bdrv_next(bs))) {
> > + AioContext *aio_context = bdrv_get_aio_context(bs);
> > +
>
> You switched iteration from QTAILQ_FOREACH to a while(bdrv_next()) loop,
> here, and in bdrv_flush_all.
Forgot about that, sorry. This change is necessary because bdrv_states
is a static variable in block.c. Use the bdrv_next() API to iterate
over BDS devices.
Kevin: Please add this to the commit message.
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2015-02-18 10:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-17 14:39 [Qemu-devel] [PATCH v2] block: move I/O request processing to block/io.c Stefan Hajnoczi
2015-02-17 16:12 ` Eric Blake
2015-02-18 10:20 ` Stefan Hajnoczi [this message]
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=20150218102017.GB6564@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).