mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
qemu-img: let 'qemu-img convert' flush data
The 'qemu-img convert -h' advertise that the default cache mode is 'writeback', while in fact it is 'unsafe'. This patch 1) fix the help manual and 2) let bdrv_close() call bdrv_flush() 2) is needed because some backend storage doesn't have a self-flush mechanism(for e.g., sheepdog), so we need to call bdrv_flush() to make sure the image is really writen to the storage instead of hanging around writeback cache forever. Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
9eb0bfca96
commit
80ccf93b88
2 changed files with 3 additions and 2 deletions
1
block.c
1
block.c
|
@ -812,6 +812,7 @@ unlink_and_fail:
|
|||
|
||||
void bdrv_close(BlockDriverState *bs)
|
||||
{
|
||||
bdrv_flush(bs);
|
||||
if (bs->drv) {
|
||||
if (bs->job) {
|
||||
block_job_cancel_sync(bs->job);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue