]> git.proxmox.com Git - mirror_qemu.git/commit
qcow2: skip writing zero buffers to empty COW areas
authorAnton Nefedov <anton.nefedov@virtuozzo.com>
Thu, 16 May 2019 14:27:49 +0000 (17:27 +0300)
committerMax Reitz <mreitz@redhat.com>
Tue, 28 May 2019 18:30:55 +0000 (20:30 +0200)
commitc8bb23cbdbe32f5c326365e0a82e1b0e68cdcd8a
tree7169d73a97be9364e328610798c54f8af16b6fa4
parent330c72957196e0ae382abcaa97ebf4eb9bc8574f
qcow2: skip writing zero buffers to empty COW areas

If COW areas of the newly allocated clusters are zeroes on the backing
image, efficient bdrv_write_zeroes(flags=BDRV_REQ_NO_FALLBACK) can be
used on the whole cluster instead of writing explicit zero buffers later
in perform_cow().

iotest 060:
write to the discarded cluster does not trigger COW anymore.
Use a backing image instead.

Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Message-id: 20190516142749.81019-2-anton.nefedov@virtuozzo.com
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-cluster.c
block/qcow2.c
block/qcow2.h
block/trace-events
qapi/block-core.json
tests/qemu-iotests/060
tests/qemu-iotests/060.out