qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 01/17] block: stop relying on io_flush() in bdrv_drain_all()
Date: Thu, 27 Jun 2013 15:29:38 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jun 27, 2013 at 03:13:19PM +0200, Paolo Bonzini wrote:
> Il 14/06/2013 13:43, Stefan Hajnoczi ha scritto:
> > 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.
> > 
> > This is the first step in removing .io_flush() so that event loops no
> > longer need to have the concept of synchronous I/O.  Eventually we may
> > be able to kill synchronous I/O completely by running everything in a
> > coroutine, but that is future work.
> > 
> > Note this patch moves bs->throttled_reqs initialization to bdrv_new() so
> > that bdrv_requests_pending(bs) can safely access it.  In practice bs is
> > g_malloc0() so the memory is already zeroed but it's safer to initialize
> > the queue properly.
> > 
> > In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close()
> > so that the device is still seen by bdrv_drain_all() when iterating
> > bdrv_states.
> 
> I wonder if this last change should be separated out and CCed to
> qemu-stable.  It seems like a bug if you close a device that has pending
> throttled operations.

Seems like a good idea.  I'll send the next version with a separated Cc:
address@hidden patch.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]