[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/38] qemu-img: let 'qemu-img convert' flush data
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 18/38] qemu-img: let 'qemu-img convert' flush data |
Date: |
Fri, 20 Apr 2012 19:01:24 +0200 |
From: Liu Yuan <address@hidden>
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 <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 1 +
qemu-img.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 4b96654..421cd1b 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);
diff --git a/qemu-img.c b/qemu-img.c
index 6a61ca8..0ae543c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -66,8 +66,8 @@ static void help(void)
" 'filename' is a disk image filename\n"
" 'fmt' is the disk image format. It is guessed automatically in
most cases\n"
" 'cache' is the cache mode used to write the output disk image,
the valid\n"
- " options are: 'none', 'writeback' (default), 'writethrough',
'directsync'\n"
- " and 'unsafe'\n"
+ " options are: 'none', 'writeback' (default, except for
convert), 'writethrough',\n"
+ " 'directsync' and 'unsafe' (default for convert)\n"
" 'size' is the disk image size in bytes. Optional suffixes\n"
" 'k' or 'K' (kilobyte, 1024), 'M' (megabyte, 1024k), 'G'
(gigabyte, 1024M)\n"
" and T (terabyte, 1024G) are supported. 'b' is ignored.\n"
--
1.7.6.5
- [Qemu-devel] [PATCH 04/38] iotests: fix error in 005, (continued)
- [Qemu-devel] [PATCH 04/38] iotests: fix error in 005, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 07/38] ide: convert ide_sector_read() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 10/38] qcow2: Fix return value of alloc_refcount_block, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 09/38] qcow2: Fix error handling in qcow2_alloc_cluster_offset, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 08/38] ide: convert ide_sector_write() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 13/38] qemu-tool: map vm_clock to rt_clock, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 11/38] block: allow interrupting a co_sleep_ns, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 17/38] aio: simplify qemu_aio_wait, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 14/38] posix-aio: merge posix_aio_process_queue and posix_aio_read, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 16/38] aio: return "AIO in progress" state from qemu_aio_wait, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 18/38] qemu-img: let 'qemu-img convert' flush data,
Kevin Wolf <=
- [Qemu-devel] [PATCH 19/38] iotests: Resolve test failures caused by hostname, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 15/38] aio: remove process_queue callback and qemu_aio_process_queue, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 20/38] qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at(), Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 22/38] qcow2: Save disk size in snapshot header, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 25/38] qcow2: Fail write_compressed when overwriting data, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 27/38] qcow2: Refactor qcow2_free_any_clusters, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 26/38] qcow2: Ignore reserved bits in L1/L2 entries, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 23/38] qcow2: Ignore reserved bits in get_cluster_offset, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 31/38] qcow2: Version 3 images, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 24/38] qcow2: Ignore reserved bits in count_contiguous_clusters(), Kevin Wolf, 2012/04/20