Re: [Qemu-devel] [PATCH v3 01/17] block: stop relying on io_flush() in bdrv_drain_all()

2013-06-14 Thread Stefan Hajnoczi
On Thu, Jun 13, 2013 at 10:33:58AM -0400, Paolo Bonzini wrote: > Il 10/06/2013 10:38, Stefan Hajnoczi ha scritto: > > On Mon, Jun 10, 2013 at 02:25:57PM +0200, Stefan Hajnoczi wrote: > >> @@ -1427,26 +1456,18 @@ void bdrv_close_all(void) > >> void bdrv_drain_all(void) > >> { > >> BlockDriver

Re: [Qemu-devel] [PATCH v3 01/17] block: stop relying on io_flush() in bdrv_drain_all()

2013-06-13 Thread Paolo Bonzini
Il 10/06/2013 10:38, Stefan Hajnoczi ha scritto: > On Mon, Jun 10, 2013 at 02:25:57PM +0200, Stefan Hajnoczi wrote: >> @@ -1427,26 +1456,18 @@ void bdrv_close_all(void) >> void bdrv_drain_all(void) >> { >> BlockDriverState *bs; >> -bool busy; >> - >> -do { >> -busy = qemu_aio

Re: [Qemu-devel] [PATCH v3 01/17] block: stop relying on io_flush() in bdrv_drain_all()

2013-06-10 Thread Stefan Hajnoczi
On Mon, Jun 10, 2013 at 02:25:57PM +0200, Stefan Hajnoczi wrote: > @@ -1427,26 +1456,18 @@ void bdrv_close_all(void) > void bdrv_drain_all(void) > { > BlockDriverState *bs; > -bool busy; > - > -do { > -busy = qemu_aio_wait(); > > +while (bdrv_requests_pending_all()) { >

[Qemu-devel] [PATCH v3 01/17] block: stop relying on io_flush() in bdrv_drain_all()

2013-06-10 Thread Stefan Hajnoczi
If a block driver has no file descriptors to monitor but there are still active requests, it can return 1 from .io_flush(). This is used to spin during synchronous I/O. Stop relying on .io_flush() and instead check QLIST_EMPTY(&bs->tracked_requests) to decide whether there are active requests. T