[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] block: move I/O request processing to block/
From: |
Stefan Hajnoczi |
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 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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.
pgpwikGD5IbXC.pgp
Description: PGP signature