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/vmdk.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/vmdk.c')
-rw-r--r-- | block/vmdk.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/vmdk.c b/block/vmdk.c index 3b376ed..6be592f 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1494,14 +1494,14 @@ static void vmdk_close(BlockDriverState *bs) vmdk_free_extents(bs); } -static int vmdk_flush(BlockDriverState *bs) +static coroutine_fn int vmdk_co_flush(BlockDriverState *bs) { int i, ret, err; BDRVVmdkState *s = bs->opaque; - ret = bdrv_flush(bs->file); + ret = bdrv_co_flush(bs->file); for (i = 0; i < s->num_extents; i++) { - err = bdrv_flush(s->extents[i].file); + err = bdrv_co_flush(s->extents[i].file); if (err < 0) { ret = err; } @@ -1568,7 +1568,7 @@ static BlockDriver bdrv_vmdk = { .bdrv_write = vmdk_co_write, .bdrv_close = vmdk_close, .bdrv_create = vmdk_create, - .bdrv_flush = vmdk_flush, + .bdrv_co_flush = vmdk_co_flush, .bdrv_is_allocated = vmdk_is_allocated, .bdrv_get_allocated_file_size = vmdk_get_allocated_file_size, |