mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
e183ef75cc
commit
8b94ff8573
10 changed files with 29 additions and 33 deletions
2
block.c
2
block.c
|
@ -2892,8 +2892,6 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
|
|||
qemu_coroutine_yield();
|
||||
return co.ret;
|
||||
}
|
||||
} else if (bs->drv->bdrv_flush) {
|
||||
return bs->drv->bdrv_flush(bs);
|
||||
} else {
|
||||
/*
|
||||
* Some block drivers always operate in either writethrough or unsafe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue