block: Fix some things about bdrv_has_zero_init()
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest11 patches 22 repliesIn review
Changes in v2 from the cover letter
- Simplified preallocation checks in qcow2 and vhdx [Kevin]
- Added patches 1 – 5, 10, 11
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | qemu-img: Fix bdrv_has_zero_init() use in convertqemu-img.c | +8 | 2 replies | |
| 2/11 | mirror: Fix bdrv_has_zero_init() useblock/ blockdev.c include/ +1 more | +24 | 3 replies | |
| 3/11 | block: Add bdrv_has_zero_init_truncate()block.c include/ include/ | +29 | 4 replies | |
| 4/11 | block: Implement .bdrv_has_zero_init_truncate()block/ block/ block/ +7 more | +18 | 2 replies | |
| 5/11 | block: Use bdrv_has_zero_init_truncate()block/ block/ | +2 | 3 replies | |
| 6/11 | qcow2: Fix .bdrv_has_zero_init()block/ | +28 | 1 reply | |
| 7/11 | vdi: Fix .bdrv_has_zero_init()block/ | +12 | 1 reply | |
| 8/11 | vhdx: Fix .bdrv_has_zero_init()block/ | +25 | 1 reply | |
| 9/11 | iotests: Convert to preallocated encrypted qcow2tests/ tests/ | +23 | 3 replies | |
| 10/11 | iotests: Test convert -n to pre-filled imagetests/ tests/ | +25 | 1 reply | |
| 11/11 | iotests: Full mirror to existing non-zero imagetests/ tests/ | +60 | 0 replies |
Reviews trailers per patch
10 of 11 patches have a Reviewed-by or Acked-by.
| Patch | Stefano Garzarella | Stefan Weil | Maxim Levitsky |
|---|---|---|---|
| 1/11 | R-b | R-b | |
| 2/11 | R-b | ||
| 3/11 | R-b | R-b | |
| 4/11 | R-b | R-b | |
| 5/11 | R-b | R-b | |
| 6/11 | R-b | ||
| 7/11 | A-b T-b | R-b | R-b |
| 8/11 | R-b | ||
| 9/11 | A-b T-b | R-b | |
| 10/11 | R-b | ||
| 11/11 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [Qemu-devel] [PATCH v2 00/11] block: Fix some things about bdrv_has_zero_init()
Hi,
See the previous cover letter for the reason for patches 6 through 9:
https://lists.nongnu.org/archive/html/qemu-block/2019-07/msg00563.html
But no only some bdrv_has_zero_init() implementations are wrong, some callers also use it the wrong way.
First, qemu-img and mirror use it for pre-existing images, where it doesn’t have any meaning. Both should consider pre-existing images to always be non-zero and not look at bdrv_has-zero_init() (patches 1, 2, and the tests in 10 and 11).
Second, vhdx and parallels call bdrv_has_zero_init() when they do not really care about an image’s post-create state but only about what happens when you grow an image. That is a bit ugly, and also overly safe when growing preallocated images without preallocating the new areas. So this series adds a new function bdrv_has_zero_init_truncate() that is more suited to vhdx's and parallel's needs (patches 3 through 5).
v2:
- Simplified preallocation checks in qcow2 and vhdx [Kevin]
- Added patches 1 – 5, 10, 11
git-backport-diff against v1:
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/11:[down] 'qemu-img: Fix bdrv_has_zero_init() use in convert' 002/11:[down] 'mirror: Fix bdrv_has_zero_init() use' 003/11:[down] 'block: Add bdrv_has_zero_init_truncate()' 004/11:[down] 'block: Implement .bdrv_has_zero_init_truncate()' 005/11:[down] 'block: Use bdrv_has_zero_init_truncate()' 006/11:[0077] [FC] 'qcow2: Fix .bdrv_has_zero_init()' 007/11:[----] [--] 'vdi: Fix .bdrv_has_zero_init()' 008/11:[0021] [FC] 'vhdx: Fix .bdrv_has_zero_init()' 009/11:[----] [--] 'iotests: Convert to preallocated encrypted qcow2' 010/11:[down] 'iotests: Test convert -n to pre-filled image' 011/11:[down] 'iotests: Full mirror to existing non-zero image'
Max Reitz (11):
qemu-img: Fix bdrv_has_zero_init() use in convert
mirror: Fix bdrv_has_zero_init() use
block: Add bdrv_has_zero_init_truncate()
block: Implement .bdrv_has_zero_init_truncate()
block: Use bdrv_has_zero_init_truncate()
qcow2: Fix .bdrv_has_zero_init()
vdi: Fix .bdrv_has_zero_init()
vhdx: Fix .bdrv_has_zero_init()
iotests: Convert to preallocated encrypted qcow2
iotests: Test convert -n to pre-filled image
iotests: Full mirror to existing non-zero image
include/block/block.h | 1 + include/block/block_int.h | 9 ++++++ block.c | 21 +++++++++++++ block/file-posix.c | 1 + block/file-win32.c | 1 + block/gluster.c | 4 +++ block/mirror.c | 11 +++++-- block/nfs.c | 1 + block/parallels.c | 2 +- block/qcow2.c | 30 +++++++++++++++++- block/qed.c | 1 + block/raw-format.c | 6 ++++ block/rbd.c | 1 + block/sheepdog.c | 1 + block/ssh.c | 1 + block/vdi.c | 13 +++++++- block/vhdx.c | 28 +++++++++++++++-- blockdev.c | 16 ++++++++-- qemu-img.c | 11 +++++-- tests/test-block-iothread.c | 2 +- tests/qemu-iotests/041 | 62 ++++++++++++++++++++++++++++++++++--- tests/qemu-iotests/041.out | 4 +-- tests/qemu-iotests/122 | 17 ++++++++++ tests/qemu-iotests/122.out | 8 +++++ tests/qemu-iotests/188 | 20 +++++++++++- tests/qemu-iotests/188.out | 4 +++ 26 files changed, 254 insertions(+), 22 deletions(-)
Signature · 1 line
2.21.0