mbox series

[v3,0/5] block: allow commit to unmap zero blocks

Message ID 20240901142405.3183874-1-libvirt-e6954efa@volkihar.be (mailing list archive)
Headers show
Series block: allow commit to unmap zero blocks | expand

Message

Vincent Vanlaer Sept. 1, 2024, 2:24 p.m. UTC
This patch series adds support for zero blocks in non-active commits.
The first three patches in the series contains the actual changes to the
commit code, the last patch adds a test for the new functionality.

---

Changes since v2:
- moved main loop of commit_run to a separate function and refactored
  the error handling.
- call blk_co_pwrite_zero even if the size of the zero region does not
  align with the sectors of the base image. This removes the need for
  the CommitMethod enum

Changes since v1:
- split up the implementation in three separate commits
- removed accidentally left over includes from testing

Vincent Vanlaer (5):
  block: get type of block allocation in commit_run
  block: move commit_run loop to separate function
  block: refactor error handling of commit_iteration
  block: allow commit to unmap zero blocks
  block: add test non-active commit with zeroed data

 block/commit.c             | 108 +++++++++++++++++++++++++------------
 tests/qemu-iotests/315     |  95 ++++++++++++++++++++++++++++++++
 tests/qemu-iotests/315.out |  54 +++++++++++++++++++
 3 files changed, 223 insertions(+), 34 deletions(-)
 create mode 100755 tests/qemu-iotests/315
 create mode 100644 tests/qemu-iotests/315.out