Skip to content

block: Introduce real BdrvChildRole

Max Reitz qemu-devel 4 versions – Applied

Status from this message: Thanks, applied to the block branch (and squashed in Eric's English

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest34 patches 19 repliesApplied
  2. v333 patches 29 repliesSuperseded
  3. v233 patches 52 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v131 patches6 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/34block: Mark commit, mirror, blkreplay as filtersblock/blkreplay.c block/commit.c block/mirror.c+5 -00 replies
2/34block: Add BlockDriver.is_formatblock/bochs.c block/cloop.c block/crypto.c +11 more+21 -00 replies
3/34block: Rename BdrvChildRole to BdrvChildClassblock.c block/backup-top.c block/blkdebug.c +14 more+141 -1330 replies
4/34block: Add BdrvChildRole and BdrvChildRoleBitsinclude/block/block.h+56 -01 reply
5/34block: Add BdrvChildRole to BdrvChildblock.c block/backup-top.c block/blkdebug.c +28 more+62 -490 replies
6/34block: Pass BdrvChildRole to bdrv_child_perm()block.c block/backup-top.c block/blkdebug.c +10 more+36 -200 replies
7/34block: Pass BdrvChildRole to .inherit_options()block.c block/block-backend.c block/vvfat.c +1 more+30 -190 replies
8/34block: Pass parent_is_format to .inherit_options()block.c block/block-backend.c block/vvfat.c +1 more+30 -130 replies
9/34block: Rename bdrv_inherited_options()block.c+4 -40 replies
10/34block: Add generic bdrv_inherited_options()block.c+81 -01 reply
11/34block: Use bdrv_inherited_options()block.c+19 -521 reply
12/34block: Unify bdrv_child_cb_attach()block.c+20 -71 reply
13/34block: Unify bdrv_child_cb_detach()block.c+20 -71 reply
14/34block: Add child_of_bdsblock.c include/block/block_int.h+25 -01 reply
15/34block: Distinguish paths in *_format_default_permsblock.c+13 -61 reply
16/34block: Pull out bdrv_default_perms_for_cow()block.c+40 -221 reply
17/34block: Pull out bdrv_default_perms_for_storage()block.c+46 -250 replies
18/34block: Relax *perms_for_storage for data childrenblock.c+48 -101 reply
19/34block: Add bdrv_default_perms()block.c include/block/block_int.h+43 -01 reply
20/34raw-format: Split raw_read_options()block/raw-format.c+65 -450 replies
21/34block: Switch child_format users to child_of_bdsblock/blkverify.c block/quorum.c+6 -40 replies
22/34block: Drop child_formatblock.c include/block/block_int.h+0 -300 replies
23/34block: Make backing files child_of_bds childrenblock.c block/backup-top.c block/vvfat.c +1 more+30 -141 reply
24/34block: Drop child_backingblock.c include/block/block_int.h+3 -581 reply
25/34block: Make format drivers use child_of_bdsblock/bochs.c block/cloop.c block/crypto.c +9 more+50 -290 replies
26/34block: Make filter drivers use child_of_bdsblock/blkdebug.c block/blklogwrites.c block/blkreplay.c +5 more+22 -121 reply
27/34block: Use child_of_bds in remaining placesblock.c block/backup-top.c block/blklogwrites.c +1 more+19 -71 reply
28/34tests: Use child_of_bds instead of child_filetests/test-bdrv-drain.c tests/test-bdrv-graph-mod.c+21 -140 replies
29/34block: Use bdrv_default_perms()block/backup-top.c block/blkdebug.c block/blklogwrites.c +20 more+43 -370 replies
30/34block: Make bdrv_filter_default_perms() staticblock.c include/block/block_int.h+11 -160 replies
31/34block: Drop bdrv_format_default_perms()block.c include/block/block_int.h+0 -300 replies
32/34block: Drop child_fileblock.c include/block/block_int.h tests/test-bdrv-drain.c+5 -431 reply
33/34block: Pass BdrvChildRole in remaining casesblock/block-backend.c block/vvfat.c+10 -51 reply
34/34block: Drop @child_class from bdrv_child_perm()block.c block/backup-top.c block/blkdebug.c +10 more+22 -591 reply

Reviews trailers per patch

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

PatchEric BlakeAlberto GarciaKevin Wolf
SeriesR-b
1/34
2/34R-b R-b
3/34R-b R-b
4/34R-b
5/34R-b
6/34R-b
7/34R-b
8/34R-b
9/34R-b
10/34R-b
11/34R-b
12/34R-b
13/34R-b
14/34R-b
15/34R-b
16/34R-b
17/34R-b
18/34R-b
19/34R-b
20/34R-b
21/34R-b
22/34R-b
23/34R-b
24/34R-b
25/34R-b
26/34R-b
27/34R-b
28/34R-b
29/34R-b
30/34R-b
31/34R-b
32/34R-b
33/34R-b
34/34R-b

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.

Read the v4 thread

Cover letter [PATCH v4 00/34] block: Introduce real BdrvChildRole

Based-on: <[email protected]> (“block: Do not call BlockDriver.bdrv_make_empty() directly”)

Branch: https://github.com/XanClic/qemu.git child-role-v4
Branch: https://git.xanclic.moe/XanClic/qemu.git child-role-v4

v1: https://lists.nongnu.org/archive/html/qemu-block/2019-11/msg00908.html
v2: https://lists.nongnu.org/archive/html/qemu-block/2020-02/msg00108.html
v3: https://lists.nongnu.org/archive/html/qemu-block/2020-02/msg00737.html

Hi,

For the “why” and “what” regarding this series, see the cover letter of v1 (linked above).

In v4, I mostly addressed Kevin’s comments (and one permission bug for pure data children in patch 18):
- Patch 1: Pulled in from the “Deal with filters” series (and added blkreplay to the mix)

- Patch 4: More comments, and added consistent notes on how many children may get a certain role

- Patch 10:
- Move the function down below child_backing, so that we get less forward declarations of static functions, and they’ll all be temporary
- Split the (role & (DATA | METADATA | FILTERED)) == DATA condition

    into (role & DATA) && !(role & (METADATA | FILTERED))

- Fixed up the comment on how backing files are opened RO only by default
- Unconditionally let @unmap default to true for children

- Patch 11: Fallout from having moved bdrv_inherited_options() down: We need a forward declaration of bdrv_open_inherit()

- Patch 12: Move bdrv_child_cb_attach() down to bdrv_inherited_options(), and add a (temporary) forward declaration for it

- Patch 13: Same as patch 12, but for bdrv_child_detach() now

- Patch 14: Drop (now unnecessary) forward declaration of bdrv_backing_update_filename()

- Patch 16: Renamed s/for_backing/for_cow/

- Patch 18: Swapped the existing patch that split bdrv_default_perms_for_storage() function into for_data() and for_metadata() for this one, which handles both cases in the existing function, but just relaxes the restrictions for pure data children
- Also, some permissions fixed: When WRITE_UNCHANGED was taken on the parent, it may need WRITE on the the data child; and if it needs WRITE, it may also need RESIZE.

- Patch 19:
- Fallout from bdrv_default_perms_for_storage() still being a single function
- Assertions that FILTERED, COW, and DATA | METADATA are mutually exclusive

- Patch 23: Use bdrv_backing_role() instead of a fixed BDRV_CHILD_COW in bdrv_open_backing_file()

- Patch 24: Fallout from bdrv_default_perms_for_storage() still being a single function

- Patch 26: blkreplay is a filter now, too

- Patch 27: Drop blkreplay (it’s now a filter, so handled in patch 26)

- Patch 31: Fallout from bdrv_default_perms_for_storage() still being a single function

- Patch 32:
- Fallout from bdrv_default_perms_for_storage() still being a single function
- Remove the temporary forward declarations added in patches 11 through 13

- Patch 33: Pass DATA | METADATA instead of just DATA for vvfat’s qcow child

- Patch 34:
- Fallout from bdrv_default_perms_for_backing() being named bdrv_default_perms_for_cow() now
- Fallout from bdrv_default_perms_for_storage() still being a single function

git-backport-diff against v3:

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/34:[down] 'block: Mark commit, mirror, blkreplay as filters' 002/34:[----] [--] 'block: Add BlockDriver.is_format' 003/34:[----] [-C] 'block: Rename BdrvChildRole to BdrvChildClass' 004/34:[0030] [FC] 'block: Add BdrvChildRole and BdrvChildRoleBits' 005/34:[----] [-C] 'block: Add BdrvChildRole to BdrvChild' 006/34:[----] [--] 'block: Pass BdrvChildRole to bdrv_child_perm()' 007/34:[----] [-C] 'block: Pass BdrvChildRole to .inherit_options()' 008/34:[----] [--] 'block: Pass parent_is_format to .inherit_options()' 009/34:[----] [--] 'block: Rename bdrv_inherited_options()' 010/34:[0021] [FC] 'block: Add generic bdrv_inherited_options()' 011/34:[0015] [FC] 'block: Use bdrv_inherited_options()' 012/34:[0025] [FC] 'block: Unify bdrv_child_cb_attach()' 013/34:[0024] [FC] 'block: Unify bdrv_child_cb_detach()' 014/34:[0003] [FC] 'block: Add child_of_bds'
015/34:[----] [--] 'block: Distinguish paths in *_format_default_perms' 016/34:[0016] [FC] 'block: Pull out bdrv_default_perms_for_cow()' 017/34:[----] [-C] 'block: Pull out bdrv_default_perms_for_storage()' 018/34:[down] 'block: Relax *perms_for_storage for data children' 019/34:[0028] [FC] 'block: Add bdrv_default_perms()' 020/34:[----] [--] 'raw-format: Split raw_read_options()' 021/34:[----] [--] 'block: Switch child_format users to child_of_bds' 022/34:[----] [--] 'block: Drop child_format'
023/34:[0002] [FC] 'block: Make backing files child_of_bds children' 024/34:[0010] [FC] 'block: Drop child_backing'
025/34:[----] [--] 'block: Make format drivers use child_of_bds' 026/34:[0005] [FC] 'block: Make filter drivers use child_of_bds' 027/34:[0005] [FC] 'block: Use child_of_bds in remaining places' 028/34:[----] [--] 'tests: Use child_of_bds instead of child_file' 029/34:[----] [-C] 'block: Use bdrv_default_perms()' 030/34:[----] [--] 'block: Make bdrv_filter_default_perms() static' 031/34:[0004] [FC] 'block: Drop bdrv_format_default_perms()' 032/34:[0013] [FC] 'block: Drop child_file'
033/34:[0004] [FC] 'block: Pass BdrvChildRole in remaining cases' 034/34:[0024] [FC] 'block: Drop @child_class from bdrv_child_perm()'

Max Reitz (34):
block: Mark commit, mirror, blkreplay as filters
block: Add BlockDriver.is_format
block: Rename BdrvChildRole to BdrvChildClass
block: Add BdrvChildRole and BdrvChildRoleBits
block: Add BdrvChildRole to BdrvChild
block: Pass BdrvChildRole to bdrv_child_perm()
block: Pass BdrvChildRole to .inherit_options()
block: Pass parent_is_format to .inherit_options()
block: Rename bdrv_inherited_options()
block: Add generic bdrv_inherited_options()
block: Use bdrv_inherited_options()
block: Unify bdrv_child_cb_attach()
block: Unify bdrv_child_cb_detach()
block: Add child_of_bds
block: Distinguish paths in *_format_default_perms
block: Pull out bdrv_default_perms_for_cow()
block: Pull out bdrv_default_perms_for_storage()
block: Relax *perms_for_storage for data children
block: Add bdrv_default_perms()
raw-format: Split raw_read_options()
block: Switch child_format users to child_of_bds
block: Drop child_format
block: Make backing files child_of_bds children
block: Drop child_backing
block: Make format drivers use child_of_bds
block: Make filter drivers use child_of_bds
block: Use child_of_bds in remaining places
tests: Use child_of_bds instead of child_file
block: Use bdrv_default_perms()
block: Make bdrv_filter_default_perms() static
block: Drop bdrv_format_default_perms()
block: Drop child_file
block: Pass BdrvChildRole in remaining cases
block: Drop @child_class from bdrv_child_perm()

 include/block/block.h       |  64 +++-
 include/block/block_int.h   |  57 ++--
 block.c                     | 578 ++++++++++++++++++++++--------------
 block/backup-top.c          |  11 +-
 block/blkdebug.c            |  10 +-
 block/blklogwrites.c        |  16 +-
 block/blkreplay.c           |   8 +-
 block/blkverify.c           |  10 +-
 block/block-backend.c       |  20 +-
 block/bochs.c               |   7 +-
 block/cloop.c               |   7 +-
 block/commit.c              |   4 +-
 block/copy-on-read.c        |   7 +-
 block/crypto.c              |   8 +-
 block/dmg.c                 |   7 +-
 block/filter-compress.c     |   7 +-
 block/io.c                  |  22 +-
 block/mirror.c              |   4 +-
 block/parallels.c           |   7 +-
 block/qcow.c                |   7 +-
 block/qcow2.c               |  20 +-
 block/qed.c                 |   7 +-
 block/quorum.c              |   8 +-
 block/raw-format.c          | 128 +++++---
 block/replication.c         |   5 +-
 block/throttle.c            |   7 +-
 block/vdi.c                 |   7 +-
 block/vhdx.c                |   7 +-
 block/vmdk.c                |  23 +-
 block/vpc.c                 |   7 +-
 block/vvfat.c               |  13 +-
 blockjob.c                  |   7 +-
 tests/test-bdrv-drain.c     |  72 ++---
 tests/test-bdrv-graph-mod.c |  10 +-
 tests/test-block-iothread.c |  17 +-
 35 files changed, 738 insertions(+), 461 deletions(-)
Signature · 1 line
2.26.2