Skip to content

block: mirror - Write zeroes for unallocated sectors if no zero init

Jeff Cody qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 31 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: allow creation of detached dirty bitmapsblock.c block/mirror.c blockdev.c +2 more+25 -93 replies
2/3block: mirror - split out part of mirror_run()block/mirror.c+110 -963 replies
3/3block: mirror - zero unallocated target sectors when zero init not presentblock/mirror.c blockdev.c include/block/block_int.h +1 more+87 -3325 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchKevin WolfMax Reitz
1/3R-b
2/3R-b R-b
3/3

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] block: mirror - Write zeroes for unallocated sectors if no zero init

When doing a block mirror to a target that does not support zero init (e.g. host device and raw format), unallocated sectors on the source may lead to a corrupted target image.

Unallocated sectors are skipped over during block mirror (the dirty bitmap is only loaded with allocated sectors), so whatever data is already present on the target device in those sectors will likely still be there, leading the guest to read invalid data.

There are 3 patches in this series:

Patch 1 allows block device dirty bitmaps to be created but not attached (i.e. placed in the dirty_bitmaps list) to a BDS. This clears the way to having a bitmap to be used to track unallocated sectors above the 'base' image.

Patch 2 splits out the mirror code that invokes mirror_iteration(), so that we can in later patches run it multiple times using different bitmaps.

Patch 3 introduces a 2-pass mirror streaming approach, whereas the first pass writes zeroes for unallocated source sectors (if appropriate for the image type), and the second pass writes the actual source data.

Jeff Cody (3):
block: allow creation of detached dirty bitmaps
block: mirror - split out part of mirror_run()
block: mirror - zero unallocated target sectors when zero init not
present

 block.c                   |  26 +++-
 block/mirror.c            | 302 ++++++++++++++++++++++++++++------------------
 blockdev.c                |   4 +-
 include/block/block.h     |   1 +
 include/block/block_int.h |   3 +-
 migration/block.c         |   2 +-
 qapi/block-core.json      |   6 +-
 7 files changed, 214 insertions(+), 130 deletions(-)
Signature · 1 line
1.9.3