qemu-e2k/block
Stefan Hajnoczi bfe8043e92 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>
2012-08-06 22:39:14 +02:00
..
blkdebug.c blkdebug: optionally tie errors to a specific sector 2012-07-09 15:53:02 +02:00
blkverify.c block: replace unchecked strdup/malloc/calloc with glib 2012-01-26 11:39:03 +01:00
bochs.c block: take lock around bdrv_read implementations 2011-10-21 17:34:14 +02:00
cloop.c block/cloop: Use g_free instead of free 2011-11-04 14:24:12 +01:00
cow.c block: Fix spelling in comment (ineffcient -> inefficient) 2012-04-19 15:48:52 +02:00
curl.c allow qemu_iovec_from_buffer() to specify offset from which to start copying 2012-06-11 23:12:11 +04:00
dmg.c block: take lock around bdrv_read implementations 2011-10-21 17:34:14 +02:00
iscsi.c Merge remote-tracking branch 'mjt/mjt-iov2' into staging 2012-07-09 12:35:06 -05:00
Makefile.objs build: move block/ objects to nested Makefile.objs 2012-06-07 09:21:13 +02:00
nbd.c cleanup qemu_co_sendv(), qemu_co_recvv() and friends 2012-06-11 23:12:11 +04:00
parallels.c block: take lock around bdrv_read implementations 2011-10-21 17:34:14 +02:00
qcow2-cache.c qcow2: always operate caches in writeback mode 2012-06-15 14:03:43 +02:00
qcow2-cluster.c qcow2: implement lazy refcounts 2012-08-06 22:39:14 +02:00
qcow2-refcount.c qcow2: preserve free_byte_offset when qcow2_alloc_bytes() fails 2012-07-09 15:53:01 +02:00
qcow2-snapshot.c qcow2: fix #ifdef'd qcow2_check_refcounts() callers 2012-07-09 15:53:01 +02:00
qcow2.c qcow2: implement lazy refcounts 2012-08-06 22:39:14 +02:00
qcow2.h qcow2: implement lazy refcounts 2012-08-06 22:39:14 +02:00
qcow.c change qemu_iovec_to_buf() to match other to,from_buf functions 2012-06-11 23:12:11 +04:00
qed-check.c qemu-img check: Print fixed clusters and recheck 2012-06-15 14:03:42 +02:00
qed-cluster.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
qed-gencb.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
qed-l2-cache.c qed: do not evict in-use L2 table cache entries 2012-03-12 15:14:06 +01:00
qed-table.c block: bdrv_aio_* do not return NULL 2011-12-15 12:40:07 +01:00
qed.c Merge remote-tracking branch 'mjt/mjt-iov2' into staging 2012-07-09 12:35:06 -05:00
qed.h qed: remove incoming live migration blocker 2012-04-05 16:29:12 +02:00
raw-posix-aio.h prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
raw-posix.c raw-posix: Fix build without is_allocated support 2012-06-24 01:04:45 +02:00
raw-win32.c block: Rename bdrv_co_flush to bdrv_co_flush_to_disk 2011-11-11 14:02:59 +01:00
raw.c raw: hook into blkdebug 2012-07-09 15:53:02 +02:00
rbd.c Merge remote-tracking branch 'mjt/mjt-iov2' into staging 2012-07-09 12:35:06 -05:00
sheepdog.c sheepdog: do not blindly memset all read buffers 2012-07-17 16:48:29 +02:00
stream.c stream: move rate limiting to a separate header file 2012-06-15 14:03:42 +02:00
vdi.c qemu-img check -r for repairing images 2012-06-15 14:03:42 +02:00
vmdk.c block: push recursive flushing up from drivers 2012-04-05 14:54:39 +02:00
vpc.c block/vpc: write checksum back to footer after check 2012-04-05 14:54:40 +02:00
vvfat.c vvfat: Do not clobber the user's geometry 2012-07-17 16:48:30 +02:00