diff options
author | Stefan Hajnoczi | 2012-07-27 10:05:22 +0200 |
---|---|---|
committer | Kevin Wolf | 2012-08-06 22:39:14 +0200 |
commit | bfe8043e9214d2fc6572cc72b5f2218308747acd (patch) | |
tree | 40d56873d87524c6b4b062f43851e44ededcae9c /tests | |
parent | qemu-iotests: ignore qemu-img create lazy_refcounts output (diff) | |
download | qemu-bfe8043e9214d2fc6572cc72b5f2218308747acd.tar.gz qemu-bfe8043e9214d2fc6572cc72b5f2218308747acd.tar.xz qemu-bfe8043e9214d2fc6572cc72b5f2218308747acd.zip |
qcow2: implement lazy refcounts
Lazy refcounts is a performance optimization for qcow2 that postpones
refcount metadata updates and instead marks the image dirty. In the
case of crash or power failure the image will be left in a dirty state
and repaired next time it is opened.
Reducing metadata I/O is important for cache=writethrough and
cache=directsync because these modes guarantee that data is on disk
after each write (hence we cannot take advantage of caching updates in
RAM). Refcount metadata is not needed for guest->file block address
translation and therefore does not need to be on-disk at the time of
write completion - this is the motivation behind the lazy refcount
optimization.
The lazy refcount optimization must be enabled at image creation time:
qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=on a.qcow2 10G
qemu-system-x86_64 -drive if=virtio,file=a.qcow2,cache=writethrough
Update qemu-iotests 031 and 036 since the extension header size changes
when we add feature bit table entries.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qemu-iotests/031.out | 12 | ||||
-rw-r--r-- | tests/qemu-iotests/036.out | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/qemu-iotests/031.out b/tests/qemu-iotests/031.out index 297b4587e3..796c993df2 100644 --- a/tests/qemu-iotests/031.out +++ b/tests/qemu-iotests/031.out @@ -54,7 +54,7 @@ header_length 72 Header extension: magic 0x6803f857 -length 48 +length 96 data <binary> Header extension: @@ -68,7 +68,7 @@ No errors were found on the image. magic 0x514649fb version 2 -backing_file_offset 0xc8 +backing_file_offset 0xf8 backing_file_size 0x17 cluster_bits 16 size 67108864 @@ -92,7 +92,7 @@ data 'host_device' Header extension: magic 0x6803f857 -length 48 +length 96 data <binary> Header extension: @@ -155,7 +155,7 @@ header_length 104 Header extension: magic 0x6803f857 -length 48 +length 96 data <binary> Header extension: @@ -169,7 +169,7 @@ No errors were found on the image. magic 0x514649fb version 3 -backing_file_offset 0xe8 +backing_file_offset 0x118 backing_file_size 0x17 cluster_bits 16 size 67108864 @@ -193,7 +193,7 @@ data 'host_device' Header extension: magic 0x6803f857 -length 48 +length 96 data <binary> Header extension: diff --git a/tests/qemu-iotests/036.out b/tests/qemu-iotests/036.out index ca0fda13d3..063ca22d66 100644 --- a/tests/qemu-iotests/036.out +++ b/tests/qemu-iotests/036.out @@ -46,7 +46,7 @@ header_length 104 Header extension: magic 0x6803f857 -length 48 +length 96 data <binary> *** done |