On Fri, Aug 09, 2013 at 07:43:57PM +0200, Charlie Shepherd wrote: > +static int bdrv_snapshot_open(BlockDriverState *bs) > +{ > + Coroutine *co; > + struct SnapOp so = { > + .bs = bs, > + .ret = NOT_DONE, > + }; > + > + co = qemu_coroutine_create(bdrv_snapshot_open_entry); > + qemu_coroutine_enter(co, &so); > + while (so.ret == NOT_DONE) { > + qemu_aio_wait(); > + } > + > + return so.ret; > +}
This is orthogonal to snapshots and should be a generic .bdrv_open() wrapper called block.c:bdrv_open() (the coroutine version should be called bdrv_co_open()).