summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorLiu Yuan <tailai.ly@taobao.com>2012-04-20 17:10:56 +0800
committerKevin Wolf <kwolf@redhat.com>2012-04-20 11:42:41 +0200
commit80ccf93b884a2edab5ec62634758e942bba81b7c (patch)
tree80603fd6aa5aeb15f71b15c5b201885118c99647 /block.c
parent9eb0bfca960b8cf24fb42e017c3a6479e5676f75 (diff)
downloadqemu-80ccf93b884a2edab5ec62634758e942bba81b7c.tar.gz
qemu-80ccf93b884a2edab5ec62634758e942bba81b7c.tar.bz2
qemu-80ccf93b884a2edab5ec62634758e942bba81b7c.zip
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>
Diffstat (limited to 'block.c')
-rw-r--r--block.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block.c b/block.c
index 4b96654e7d..421cd1bebd 100644
--- a/block.c
+++ b/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);