mbox series

[v2,00/33] block: Introduce real BdrvChildRole

Message ID 20200204170848.614480-1-mreitz@redhat.com (mailing list archive)
Headers show
Series block: Introduce real BdrvChildRole | expand

Message

Max Reitz Feb. 4, 2020, 5:08 p.m. UTC
Based-on: <20200130214431.333510-1-mreitz@redhat.com>
(“block: Fix check_to_replace_node()”)

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

v1: https://lists.nongnu.org/archive/html/qemu-block/2019-11/msg00908.html


Hi,

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


v2:
- Dropped BDRV_CHILD_STAY_AT_NODE from BdrvChildRole

- Dropped BDRV_CHILD_PROTOCOL and BDRV_CHILD_FORMAT from BdrvChildRole;
  this necessitates a BlockDriver.is_format flag that
  BdrvChildClass.inherit_options() receives and from which (and the
  BdrvChildRole) it can figure out whether to set, clear, or bequeath
  BDRV_O_PROTOCOL.

- Document that BDRV_CHILD_PRIMARY must be set for at most one child at
  a time.

- Rebasing conflicts with the compress filter

- Split “block: Unify bdrv_*inherited_options()” into three patches (8
  through 10)

- Dropped the old patch 6 (“Keep BDRV_O_NO_IO...”) because it
  effectively didn’t do anything (child_file.inherit_options() still
  cleared BDRV_O_NO_IO).  Implicitly do the change in patch 10 instead
  and explain it in the commit message.


git-backport-diff against 1:

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


Max Reitz (33):
  block: Add BlockDriver.is_format
  block: Rename BdrvChildRole to BdrvChildClass
  block: Add BdrvChildRole
  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_backing()
  block: Pull out bdrv_default_perms_for_storage()
  block: Split bdrv_default_perms_for_storage()
  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()

 block.c                     | 521 ++++++++++++++++++++++--------------
 block/backup-top.c          |  11 +-
 block/blkdebug.c            |  10 +-
 block/blklogwrites.c        |  16 +-
 block/blkreplay.c           |   7 +-
 block/blkverify.c           |  10 +-
 block/block-backend.c       |  20 +-
 block/bochs.c               |   7 +-
 block/cloop.c               |   7 +-
 block/commit.c              |   2 +-
 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              |   2 +-
 block/parallels.c           |   7 +-
 block/qcow.c                |   7 +-
 block/qcow2.c               |  20 +-
 block/qed.c                 |   7 +-
 block/quorum.c              |   9 +-
 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               |  11 +-
 blockjob.c                  |   7 +-
 include/block/block.h       |  35 ++-
 include/block/block_int.h   |  57 ++--
 tests/test-bdrv-drain.c     |  72 +++--
 tests/test-bdrv-graph-mod.c |  10 +-
 tests/test-block-iothread.c |  17 +-
 35 files changed, 672 insertions(+), 435 deletions(-)