[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 07/15] Call bdrv->open via a synchronous wrappe
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC v2 07/15] Call bdrv->open via a synchronous wrapper in block/snapshot.c |
Date: |
Thu, 29 Aug 2013 17:14:43 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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()).
- [Qemu-devel] [RFC v2 03/15] Explicitly mark BlockDriver function .bdrv_create as coroutine and rename it bdrv_co_create., (continued)
- [Qemu-devel] [RFC v2 03/15] Explicitly mark BlockDriver function .bdrv_create as coroutine and rename it bdrv_co_create., Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 05/15] Make qcow2_open synchronous, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 04/15] Convert .bdrv_open and .bdrv_file_open to coroutine_fn, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 07/15] Call bdrv->open via a synchronous wrapper in block/snapshot.c, Charlie Shepherd, 2013/08/09
- Re: [Qemu-devel] [RFC v2 07/15] Call bdrv->open via a synchronous wrapper in block/snapshot.c,
Stefan Hajnoczi <=
- [Qemu-devel] [RFC v2 06/15] Explicitly mark BlockDriver functions .bdrv_write and .bdrv_read as coroutine functions, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 08/15] Convert bdrv_create and associated functions to be coroutine_fn, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 09/15] Add a synchronous wrapper bdrv_sync_rwco, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 11/15] Make bdrv_discard coroutine only and add bdrv_sync_discard, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 12/15] Make bdrv_flush coroutine only and add bdrv_sync_flush, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 10/15] Convert bdrv_read, bdrv_write and associated functions to coroutine functions, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 13/15] Introduce a run_handler function in qemu-img.c, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 15/15] Add coroutine_fn annotations to nbd_co_* functions., Charlie Shepherd, 2013/08/09