From 8b94ff85737062876c03e7506abb500521c749b9 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 20 Oct 2011 13:16:24 +0200 Subject: 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 Signed-off-by: Kevin Wolf --- block/cow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'block/cow.c') diff --git a/block/cow.c b/block/cow.c index 29fa8444a3..707c0aad88 100644 --- a/block/cow.c +++ b/block/cow.c @@ -306,9 +306,9 @@ exit: return ret; } -static int cow_flush(BlockDriverState *bs) +static coroutine_fn int cow_co_flush(BlockDriverState *bs) { - return bdrv_flush(bs->file); + return bdrv_co_flush(bs->file); } static QEMUOptionParameter cow_create_options[] = { @@ -334,7 +334,7 @@ static BlockDriver bdrv_cow = { .bdrv_write = cow_co_write, .bdrv_close = cow_close, .bdrv_create = cow_create, - .bdrv_flush = cow_flush, + .bdrv_co_flush = cow_co_flush, .bdrv_is_allocated = cow_is_allocated, .create_options = cow_create_options, -- cgit v1.2.1