Skip to content

block: cleanup backing and file handling

Vladimir Sementsov-Ogievskiy qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14block: BlockDriver: add .filtered_child_is_backing fieldblock/commit.c block/mirror.c include/block/block_int.h+16 -00 replies
2/14block: introduce bdrv_open_file_child() helperblock.c block/blkdebug.c block/blklogwrites.c +21 more+94 -1000 replies
3/14block/blklogwrites: don't care to remove bs->file child on failureblock/blklogwrites.c+0 -40 replies
4/14test-bdrv-graph-mod: update test_parallel_perm_update test casetests/unit/test-bdrv-graph-mod.c+44 -260 replies
5/14tests-bdrv-drain: bdrv_replace_test driver: declare supports_backingtests/unit/test-bdrv-drain.c+1 -00 replies
6/14test-bdrv-graph-mod: fix filters to be filtersinclude/block/block_int.h tests/unit/test-bdrv-graph-mod.c+20 -90 replies
7/14block: document connection between child roles and bs->backing/bs->fileinclude/block/block.h+42 -00 replies
8/14block/snapshot: stress that we fallback to primary childblock/snapshot.c+10 -200 replies
9/14Revert "block: Let replace_child_noperm free children"block.c+23 -790 replies
10/14Revert "block: Let replace_child_tran keep indirect pointer"block.c+10 -730 replies
11/14Revert "block: Restructure remove_file_or_backing_child()"block.c+9 -120 replies
12/14Revert "block: Pass BdrvChild ** to replace_child_noperm"block.c+11 -120 replies
13/14block: Manipulate bs->file / bs->backing pointers in .attach/.detachblock.c block/raw-format.c block/snapshot.c +2 more+88 -970 replies
14/14block/snapshot: drop indirection around bdrv_snapshot_fallback_ptrblock/snapshot.c+17 -220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/14] block: cleanup backing and file handling

Hi all!

I started this as a follow-up to
"block: Attempt on fixing 030-reported errors" by Hanna.

In Hanna's series I really like how bs->children handling moved to .attach/.detach handlers.

.file and .backing are kind of "shortcuts" or "links" to some elementes of this list, they duplicate the information. So they should be updated in the same place to be in sync.

On the way to this target, I do also the following cleanups:

- establish, which restrictions we have on how much children of different roles should node has, and which of the should be linked in .file / .backing. Add documentation and assertions.

- drop all the complicated logic around passing pointer to bs->backing / bs->file (BdrvChild **c), so that the field be automatically updated. Now they are natively automatically updated in .attach/.detach, so the rest of the code becomes simpler.

- now .file / .backing are updated ONLY in .attach / .detach, no other code modify these fields

Vladimir Sementsov-Ogievskiy (14):
block: BlockDriver: add .filtered_child_is_backing field
block: introduce bdrv_open_file_child() helper block/blklogwrites: don't care to remove bs->file child on failure
test-bdrv-graph-mod: update test_parallel_perm_update test case
tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing
test-bdrv-graph-mod: fix filters to be filters
block: document connection between child roles and

    bs->backing/bs->file

block/snapshot: stress that we fallback to primary child Revert "block: Let replace_child_noperm free children" Revert "block: Let replace_child_tran keep indirect pointer" Revert "block: Restructure remove_file_or_backing_child()" Revert "block: Pass BdrvChild ** to replace_child_noperm"
block: Manipulate bs->file / bs->backing pointers in .attach/.detach block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr

 include/block/block.h            |  45 +++++
 include/block/block_int.h        |  30 ++-
 block.c                          | 335 ++++++++++---------------------
 block/blkdebug.c                 |   9 +-
 block/blklogwrites.c             |  11 +-
 block/blkreplay.c                |   7 +-
 block/blkverify.c                |   9 +-
 block/bochs.c                    |   7 +-
 block/cloop.c                    |   7 +-
 block/commit.c                   |   1 +
 block/copy-before-write.c        |   9 +-
 block/copy-on-read.c             |   9 +-
 block/crypto.c                   |  11 +-
 block/dmg.c                      |   7 +-
 block/filter-compress.c          |   6 +-
 block/mirror.c                   |   1 +
 block/parallels.c                |   7 +-
 block/preallocate.c              |   9 +-
 block/qcow.c                     |   6 +-
 block/qcow2.c                    |   8 +-
 block/qed.c                      |   8 +-
 block/raw-format.c               |   4 +-
 block/replication.c              |   8 +-
 block/snapshot.c                 |  60 ++----
 block/throttle.c                 |   8 +-
 block/vdi.c                      |   7 +-
 block/vhdx.c                     |   7 +-
 block/vmdk.c                     |   7 +-
 block/vpc.c                      |   7 +-
 tests/unit/test-bdrv-drain.c     |  11 +-
 tests/unit/test-bdrv-graph-mod.c |  94 ++++++---
 31 files changed, 343 insertions(+), 412 deletions(-)
Signature · 1 line
2.31.1