[PATCH v4 0/5] block: allow commit to unmap zero blocks

2024-10-26 Thread Vincent Vanlaer
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

[PATCH v4 5/5] block: add test non-active commit with zeroed data

2024-10-26 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer Tested-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/commit-zero-blocks | 96 +++ .../qemu-iotests/tests/commit-zero-blocks.out | 54 +++ 2 files changed, 150 insertions

[PATCH v4 1/5] block: get type of block allocation in commit_run

2024-10-26 Thread Vincent Vanlaer
bdrv_co_common_block_status_above not only returns whether the block is allocated, but also if it contains zeroes. Signed-off-by: Vincent Vanlaer Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/commit.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block

[PATCH v4 4/5] block: allow commit to unmap zero blocks

2024-10-26 Thread Vincent Vanlaer
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 Reviewed-by

[PATCH v4 3/5] block: refactor error handling of commit_iteration

2024-10-26 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer --- block/commit.c | 61 -- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/block/commit.c b/block/commit.c index 078e54f51f..5c24c8b80a 100644 --- a/block/commit.c +++ b/block/commit.c @@ -129,51

[PATCH v4 2/5] block: move commit_run loop to separate function

2024-10-26 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/commit.c | 89 +- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/block/commit.c b/block/commit.c index 8dee25b313..078e54f51f 100644 --- a/block

[PATCH v3 4/5] block: allow commit to unmap zero blocks

2024-09-01 Thread Vincent Vanlaer
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 --- block

[PATCH v3 2/5] block: move commit_run loop to separate function

2024-09-01 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer --- block/commit.c | 85 -- 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/block/commit.c b/block/commit.c index 8dee25b313..9eedd1fa47 100644 --- a/block/commit.c +++ b/block/commit.c @@ -128,6

[PATCH v3 1/5] block: get type of block allocation in commit_run

2024-09-01 Thread Vincent Vanlaer
bdrv_co_common_block_status_above not only returns whether the block is allocated, but also if it contains zeroes. Signed-off-by: Vincent Vanlaer Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/commit.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block

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

2024-09-01 Thread Vincent Vanlaer
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

[PATCH v3 5/5] block: add test non-active commit with zeroed data

2024-09-01 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer --- tests/qemu-iotests/315 | 95 ++ tests/qemu-iotests/315.out | 54 ++ 2 files changed, 149 insertions(+) create mode 100755 tests/qemu-iotests/315 create mode 100644 tests/qemu-iotests/315.out diff

[PATCH v3 3/5] block: refactor error handling of commit_iteration

2024-09-01 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer --- block/commit.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/block/commit.c b/block/commit.c index 9eedd1fa47..288e413be3 100644 --- a/block/commit.c +++ b/block/commit.c @@ -130,7 +130,6 @@ static

Re: [PATCH v2 3/4] block: allow commit to unmap zero blocks

2024-09-01 Thread Vincent Vanlaer
On 2/08/2024 12:58, Vladimir Sementsov-Ogievskiy wrote: On 14.07.24 00:56, Vincent Vanlaer wrote: 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

[PATCH v2 3/4] block: allow commit to unmap zero blocks

2024-07-13 Thread Vincent Vanlaer
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 --- block

[PATCH v2 2/4] block: refactor commit_run for multiple write types

2024-07-13 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer --- block/commit.c | 39 --- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/block/commit.c b/block/commit.c index 8dee25b313..fb54fc9560 100644 --- a/block/commit.c +++ b/block/commit.c @@ -128,6 +128,11

[PATCH v2 1/4] block: get type of block allocation in commit_run

2024-07-13 Thread Vincent Vanlaer
bdrv_co_common_block_status_above not only returns whether the block is allocated, but also if it contains zeroes. Signed-off-by: Vincent Vanlaer --- block/commit.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block/commit.c b/block/commit.c index 7c3fdcb0ca

[PATCH v2 4/4] block: add test non-active commit with zeroed data

2024-07-13 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer --- tests/qemu-iotests/315 | 95 ++ tests/qemu-iotests/315.out | 54 ++ 2 files changed, 149 insertions(+) create mode 100755 tests/qemu-iotests/315 create mode 100644 tests/qemu-iotests/315.out diff

[PATCH v2 0/4] block: allow commit to unmap zero blocks

2024-07-13 Thread Vincent Vanlaer
- removed accidentally left over includes from testing Vincent Vanlaer (4): block: get type of block allocation in commit_run block: refactor commit_run for multiple write types block: allow commit to unmap zero blocks block: add test non-active commit with zeroed data block/commit.c

[PATCH 0/2] block: allow commit to unmap zero blocks

2024-05-26 Thread Vincent Vanlaer
This patch series adds support for zero blocks in non-active commits. The first patch in the series contains the actual changes to the commit code, the second patch adds a test for the new functionality. Vincent Vanlaer (2): block: allow commit to unmap zero blocks block: add test non-active

[PATCH 1/2] block: allow commit to unmap zero blocks

2024-05-26 Thread Vincent Vanlaer
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 oother arbitrary data. Signed-off-by: Vincent Vanlaer --- block

[PATCH 2/2] block: add test non-active commit with zeroed data

2024-05-26 Thread Vincent Vanlaer
Signed-off-by: Vincent Vanlaer --- tests/qemu-iotests/315 | 95 ++ tests/qemu-iotests/315.out | 54 ++ 2 files changed, 149 insertions(+) create mode 100755 tests/qemu-iotests/315 create mode 100644 tests/qemu-iotests/315.out diff