Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Paolo Bonzini
On 10/14/2011 04:02 PM, Kevin Wolf wrote: > > It would still host the checks on BDRV_O_NO_FLUSH and bs->drv->*_flush. > It would be the same as bdrv_flush_co_entry is now, minus the > marshalling in/out of the RwCo. Right. By the way, I like how you handle all three backends in the same f

Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Kevin Wolf
Am 14.10.2011 14:42, schrieb Paolo Bonzini: > On 10/14/2011 01:54 PM, Kevin Wolf wrote: >> Am 14.10.2011 13:30, schrieb Paolo Bonzini: >>> On 10/14/2011 01:08 PM, Kevin Wolf wrote: Am 14.10.2011 10:41, schrieb Paolo Bonzini: > Add coroutine support for flush and apply the same emulation th

Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Paolo Bonzini
On 10/14/2011 03:20 PM, Stefan Hajnoczi wrote: It's just too tempting to call these functions in contexts where it is not okay to do so. The bdrv_co_*() functions are all tagged as coroutine_fn and make it clear that they can yield. Yes, I agree. We already have an event loop in qemu-img exc

Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Stefan Hajnoczi
On Fri, Oct 14, 2011 at 01:54:42PM +0200, Kevin Wolf wrote: > Am 14.10.2011 13:30, schrieb Paolo Bonzini: > > On 10/14/2011 01:08 PM, Kevin Wolf wrote: > >> Am 14.10.2011 10:41, schrieb Paolo Bonzini: > > Let me show how this might go. Right now you have > > > > bdrv_read/write > >

Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Paolo Bonzini
On 10/14/2011 01:54 PM, Kevin Wolf wrote: Am 14.10.2011 13:30, schrieb Paolo Bonzini: On 10/14/2011 01:08 PM, Kevin Wolf wrote: Am 14.10.2011 10:41, schrieb Paolo Bonzini: Add coroutine support for flush and apply the same emulation that we already do for read/write. bdrv_aio_flush is simplif

Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Kevin Wolf
Am 14.10.2011 13:30, schrieb Paolo Bonzini: > On 10/14/2011 01:08 PM, Kevin Wolf wrote: >> Am 14.10.2011 10:41, schrieb Paolo Bonzini: >>> Add coroutine support for flush and apply the same emulation that >>> we already do for read/write. bdrv_aio_flush is simplified to always >>> go through a cor

Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Paolo Bonzini
On 10/14/2011 01:08 PM, Kevin Wolf wrote: Am 14.10.2011 10:41, schrieb Paolo Bonzini: Add coroutine support for flush and apply the same emulation that we already do for read/write. bdrv_aio_flush is simplified to always go through a coroutine. Signed-off-by: Paolo Bonzini To make the implem

Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Kevin Wolf
Am 14.10.2011 10:41, schrieb Paolo Bonzini: > Add coroutine support for flush and apply the same emulation that > we already do for read/write. bdrv_aio_flush is simplified to always > go through a coroutine. > > Signed-off-by: Paolo Bonzini To make the implementation more consistent with read/

[Qemu-devel] [PATCH 2/4] block: unify flush implementations

2011-10-14 Thread Paolo Bonzini
Add coroutine support for flush and apply the same emulation that we already do for read/write. bdrv_aio_flush is simplified to always go through a coroutine. Signed-off-by: Paolo Bonzini --- block.c | 160 ++- block_int.h |1 + 2