]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: allow commit to unmap zero blocks
authorVincent Vanlaer <libvirt-e6954efa@volkihar.be>
Sat, 26 Oct 2024 16:30:08 +0000 (18:30 +0200)
committerVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Thu, 1 May 2025 09:12:19 +0000 (12:12 +0300)
commit6f3199f99600fe75f32f78574e507f347de80854
treea92da05a341938734993f83626d9563ffffdc956
parent0648c76ad198e91515771fbbeaac3a3807669a4a
block: allow commit to unmap zero blocks

Non-active block commits do not discard blocks only containing zeros,
causing images to lose sparseness after the commit. This commit fixes
that by writing zero blocks using blk_co_pwrite_zeroes rather than
writing them out as any other arbitrary data.

Signed-off-by: Vincent Vanlaer <libvirt-e6954efa@volkihar.be>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20241026163010.2865002-5-libvirt-e6954efa@volkihar.be>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
block/commit.c