Skip to content

implement discard operation for Parallels images

Denis V. Lunev qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest22 patches 4 repliesIn review
  2. v121 patches 33 repliesSuperseded

Changes in v2 from the cover letter

* added #3 - fix memory leak in parallels_open
* rewritten #4 (orig #3) - reflecting leak fixed previous patch
* fixed warning in #7 (orig #6), thanks Mike!
* fixed typo in #16 (was #15)
* fixed warning in #19 (was #18)
* fixed wrong argument for bdrv_co_pdiscard in #19 (was #18)
* improved discard tests in #20 (was #19)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22parallels: fix formatting in bdrv_parallels initializationblock/parallels.c+19 -170 replies
2/22parallels: mark driver as supporting CBTblock/parallels.c+6 -00 replies
3/22parallels: fix memory leak in parallels_open()block/parallels.c+1 -01 reply
4/22parallels: invent parallels_opts_prealloc() helper to parse prealloc optsblock/parallels.c+44 -281 reply
5/22parallels: return earler in fail_format branch in parallels_open()block/parallels.c+2 -10 replies
6/22parallels: return earlier from parallels_open() function on errorblock/parallels.c+5 -90 replies
7/22parallels: refactor path when we need to re-check image in parallels_openblock/parallels.c+10 -110 replies
8/22parallels: create mark_used() helper which sets bit in used bitmapblock/parallels.c+25 -90 replies
9/22tests: ensure that image validation will not cure the corruptiontests/qemu-iotests/tests/parallels-checks+5 -40 replies
10/22parallels: fix broken parallels_check_data_off()block/parallels.c+1 -00 replies
11/22parallels: add test which will validate data_off fixes through repairtests/qemu-iotests/tests/parallels-checks tests/qemu-iotests/tests/parallels-checks.out+35 -00 replies
12/22parallels: collect bitmap of used clusters at openblock/parallels.c block/parallels.h+76 -00 replies
13/22tests: fix broken deduplication check in parallels format testtests/qemu-iotests/tests/parallels-checks tests/qemu-iotests/tests/parallels-checks.out+22 -80 replies
14/22tests: test self-cure of parallels image with duplicated clusterstests/qemu-iotests/tests/parallels-checks tests/qemu-iotests/tests/parallels-checks.out+67 -00 replies
15/22parallels: accept multiple clusters in mark_used()block/parallels.c+10 -80 replies
16/22parallels: update used bitmap in allocate_clusterblock/parallels.c+14 -00 replies
17/22parallels: naive implementation of allocate_clusters with used bitmapblock/parallels.c+39 -120 replies
18/22parallels: improve readability of allocate_clustersblock/parallels.c+5 -80 replies
19/22parallels: naive implementation of parallels_co_pdiscardblock/parallels.c+46 -01 reply
20/22tests: extend test 131 to cover availability of the discard operationtests/qemu-iotests/131 tests/qemu-iotests/131.out+69 -01 reply
21/22parallels: naive implementation of parallels_co_pwrite_zeroesblock/parallels.c+14 -00 replies
22/22tests: extend test 131 to cover availability of the write-zeroestests/qemu-iotests/131 tests/qemu-iotests/131.out+43 -00 replies

Reviews trailers per patch

All 22 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlexander Ivanov
SeriesR-b
1/22R-b
2/22R-b
3/22R-b
4/22R-b
5/22R-b
6/22R-b
7/22R-b
8/22R-b
9/22R-b
10/22R-b
11/22R-b
12/22R-b
13/22R-b
14/22R-b
15/22R-b
16/22R-b
17/22R-b
18/22R-b
19/22R-b
20/22R-b
21/22R-b
22/22R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/22] implement discard operation for Parallels images

This series introduces new block allocator scheme into unused data blocks inside the image first and only after that extends the file. On top of that naive implementation of discard and write-zeroes (through the discard) is added.

There are also a bunch of bugs revealed in the code during the implementation and testing.

Changes from v1:
* added #3 - fix memory leak in parallels_open
* rewritten #4 (orig #3) - reflecting leak fixed previous patch
* fixed warning in #7 (orig #6), thanks Mike!
* fixed typo in #16 (was #15)
* fixed warning in #19 (was #18)
* fixed wrong argument for bdrv_co_pdiscard in #19 (was #18)
* improved discard tests in #20 (was #19)

Denis V. Lunev (22):
parallels: fix formatting in bdrv_parallels initialization
parallels: mark driver as supporting CBT
parallels: fix memory leak in parallels_open()
parallels: invent parallels_opts_prealloc() helper to parse prealloc
opts
parallels: return earler in fail_format branch in parallels_open()
parallels: return earlier from parallels_open() function on error
parallels: refactor path when we need to re-check image in
parallels_open
parallels: create mark_used() helper which sets bit in used bitmap
tests: ensure that image validation will not cure the corruption
parallels: fix broken parallels_check_data_off()
parallels: add test which will validate data_off fixes through repair
parallels: collect bitmap of used clusters at open
tests: fix broken deduplication check in parallels format test
tests: test self-cure of parallels image with duplicated clusters
parallels: accept multiple clusters in mark_used()
parallels: update used bitmap in allocate_cluster
parallels: naive implementation of allocate_clusters with used bitmap
parallels: improve readability of allocate_clusters
parallels: naive implementation of parallels_co_pdiscard
tests: extend test 131 to cover availability of the discard operation
parallels: naive implementation of parallels_co_pwrite_zeroes
tests: extend test 131 to cover availability of the write-zeroes

 block/parallels.c                             | 389 ++++++++++++++----
 block/parallels.h                             |   3 +
 tests/qemu-iotests/131                        |  52 +++
 tests/qemu-iotests/131.out                    |  60 +++
 tests/qemu-iotests/tests/parallels-checks     |  76 +++-
 tests/qemu-iotests/tests/parallels-checks.out |  65 ++-
 6 files changed, 544 insertions(+), 101 deletions(-)
Signature · 1 line
2.34.1