Skip to content

block/mirror: Fix (?) target backing BDS

Max Reitz qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 9 repliesIn review
  2. v23 patches 12 repliesSuperseded
  3. v12 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Patch 1:
- More verbose commit message [Kevin]
- Changed comment to match code [Kevin]
- Patch 2:
- Do not force use of the source backing chain for the target in "existing" mode or with blockdev-mirror [Kevin]
- Instead keep doing what we've been doing for drive-mirror/existing, only that we should still drop the bdrv_set_backing_hd() in bdrv_replace_in_backing_chain()
- And for blockdev-mirror, just do not change the current backing chain at all; this is what we've been doing until now, unless the target BDS did not have a backing BDS yet
- Patch 3: Added, because it makes the next test a bit nicer
- Patch 4: Adjusted to v3 behavior, and added a new test for blockdev-mirror with a target whose backing file has been overridden using the "backing" option
- Patch 5: Added [Kevin]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5block: Allow replacement of a BDS by its overlayblock.c+15 -12 replies
2/5block/mirror: Fix target backing BDSblock.c block/mirror.c blockdev.c +1 more+57 -230 replies
3/5block/null: Implement bdrv_refresh_filename()block/null.c+20 -02 replies
4/5iotests: Add test for post-mirror backing chainstests/qemu-iotests/155 tests/qemu-iotests/155.out tests/qemu-iotests/group+269 -02 replies
5/5iotests: Add test for oVirt-like storage migrationtests/qemu-iotests/156 tests/qemu-iotests/156.out tests/qemu-iotests/group+223 -00 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFam ZhengKevin Wolf
SeriesR-b R-b
1/5
2/5
3/5
4/5
5/5

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

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 0/5] block/mirror: Fix (?) target backing BDS

Issue #1: If the target image does not have a backing BDS before mirror completion, qemu tries really hard to give it a backing BDS. If the source has a backing BDS, it will actually always "succeed". In some cases, the target is not supposed to have a backing BDS, though (absolute-paths: because of sync=full; existing: because the target image does not have a backing file; blockdev-mirror: because of an explicit "backing": ""). Then, this is pretty bad behavior.

This should generally not change the target's visible data, but it still is ugly.

Issue #2: Currently the backing chain of the target is basically opened using bdrv_open_backing_file() (except for sometimes™). This results in multiple BDSs for a single physical file, which is bad. In most use cases, this is only temporary, but it still is bad.

If we can reuse the existing backing chain of the source (which is with drive-mirror in "absolute-paths" mode), we should just do so.

v3:
- Patch 1:
- More verbose commit message [Kevin]
- Changed comment to match code [Kevin]
- Patch 2:
- Do not force use of the source backing chain for the target in "existing" mode or with blockdev-mirror [Kevin]
- Instead keep doing what we've been doing for drive-mirror/existing, only that we should still drop the bdrv_set_backing_hd() in bdrv_replace_in_backing_chain()
- And for blockdev-mirror, just do not change the current backing chain at all; this is what we've been doing until now, unless the target BDS did not have a backing BDS yet
- Patch 3: Added, because it makes the next test a bit nicer
- Patch 4: Adjusted to v3 behavior, and added a new test for blockdev-mirror with a target whose backing file has been overridden using the "backing" option
- Patch 5: Added [Kevin]

git-backport-diff against v2:

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/5:[0005] [FC] 'block: Allow replacement of a BDS by its overlay' 002/5:[0057] [FC] 'block/mirror: Fix target backing BDS' 003/5:[down] 'block/null: Implement bdrv_refresh_filename()' 004/5:[0073] [FC] 'iotests: Add test for post-mirror backing chains' 005/5:[down] 'iotests: Add test for oVirt-like storage migration'

Max Reitz (5):
block: Allow replacement of a BDS by its overlay block/mirror: Fix target backing BDS block/null: Implement bdrv_refresh_filename()
iotests: Add test for post-mirror backing chains
iotests: Add test for oVirt-like storage migration

 block.c                    |  24 +++--
 block/mirror.c             |  39 +++++--
 block/null.c               |  20 ++++
 blockdev.c                 |  15 ++-
 include/block/block_int.h  |  18 +++-
 tests/qemu-iotests/155     | 263 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/155.out |   5 +
 tests/qemu-iotests/156     | 174 ++++++++++++++++++++++++++++++
 tests/qemu-iotests/156.out |  48 +++++++++
 tests/qemu-iotests/group   |   2 +
 10 files changed, 584 insertions(+), 24 deletions(-)
 create mode 100755 tests/qemu-iotests/155
 create mode 100644 tests/qemu-iotests/155.out
 create mode 100755 tests/qemu-iotests/156
 create mode 100644 tests/qemu-iotests/156.out
Signature · 1 line
2.8.3