diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-10-20 13:16:24 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-10-21 17:34:14 +0200 |
commit | 8b94ff85737062876c03e7506abb500521c749b9 (patch) | |
tree | 5bb67bd0896bb49a064e041c30cf61d2d4ce0a40 /block/vdi.c | |
parent | e183ef75cc28d31addbb937a4680090495786944 (diff) | |
download | qemu-8b94ff85737062876c03e7506abb500521c749b9.zip qemu-8b94ff85737062876c03e7506abb500521c749b9.tar.gz qemu-8b94ff85737062876c03e7506abb500521c749b9.tar.bz2 |
block: change flush to co_flush
Since coroutine operation is now mandatory, convert all bdrv_flush
implementations to coroutines. For qcow2, this means taking the lock.
Other implementations are simpler and just forward bdrv_flush to the
underlying protocol, so they can avoid the lock.
The bdrv_flush callback is then unused and can be eliminated.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vdi.c')
-rw-r--r-- | block/vdi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/vdi.c b/block/vdi.c index 1d5ad2b..883046d 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -936,10 +936,10 @@ static void vdi_close(BlockDriverState *bs) { } -static int vdi_flush(BlockDriverState *bs) +static coroutine_fn int vdi_co_flush(BlockDriverState *bs) { logout("\n"); - return bdrv_flush(bs->file); + return bdrv_co_flush(bs->file); } @@ -975,7 +975,7 @@ static BlockDriver bdrv_vdi = { .bdrv_open = vdi_open, .bdrv_close = vdi_close, .bdrv_create = vdi_create, - .bdrv_flush = vdi_flush, + .bdrv_co_flush = vdi_co_flush, .bdrv_is_allocated = vdi_is_allocated, .bdrv_make_empty = vdi_make_empty, |