Skip to content

bdrv_reopen() overhaul, part 1

Kevin Wolf qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest13 patches 13 repliesIn review
  2. v134 patches 95 repliesSuperseded

Changes in v2 from the cover letter

- Patch 1:
Added a real commit message [Eric]
Fixed function comment [Eric]
Handle overflows [Max]

- Patch 2: Fixed function comment [Eric]

- New patch 3: Added test cases for new QDict functions [Eric]

- Patch 7 (was 6): Fixed opts leak [Max]

- Patch 8 (was 7):
Improved comment [Eric]
Fixed coding style [Max]

- New patches 9 and 10: bdrv_swap() needs to fix up all list heads of non-empty lists in BlockDriverState. Add bdrv_drain() to ensure that the tracked requests list is empty; add a macro for fixing up non-empty lists.

- Patch 11 (was 8):
Fixed bdrv_swap() for bs->children (fix up list head) Remove entries from bs->children list before free()ing them

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13qdict: Add qdict_array_entries()include/qapi/qmp/qdict.h qobject/qdict.c+75 -42 replies
2/13qdict: Add qdict_{set, copy}_default()include/qapi/qmp/qdict.h qobject/qdict.c+36 -01 reply
3/13check-qdict: Test cases for new functionstests/check-qdict.c+67 -02 replies
4/13quorum: Use bdrv_open_image()block/quorum.c+11 -400 replies
5/13vmdk: Use bdrv_open_image()block/vmdk.c+21 -130 replies
6/13block: Use macro for cache option namesblockdev.c include/block/block.h+20 -120 replies
7/13block: Use QemuOpts in bdrv_open_common()block.c+34 -52 replies
8/13block: Move flag inheritance to bdrv_open_inherit()block.c block/blkdebug.c block/blkverify.c +4 more+78 -220 replies
9/13block: Drain requests before swapping nodes in bdrv_swap()block.c+6 -02 replies
10/13queue.h: Add QLIST_FIX_HEAD_PTR()include/qemu/queue.h+6 -02 replies
11/13block: Add list of children to BlockDriverStateblock.c include/block/block_int.h+45 -02 replies
12/13block: Add BlockDriverState.inherits_fromblock.c include/block/block_int.h+21 -00 replies
13/13block: Fix reopen flag inheritanceblock.c block/vmdk.c+13 -280 replies

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchMax ReitzEric BlakeJeff CodyAlberto Garcia
1/13R-b R-b
2/13R-b R-b
3/13R-b R-b
4/13R-b R-b R-b R-b
5/13R-b R-b R-b
6/13R-b R-b R-b R-b
7/13R-b R-b
8/13R-b R-b
9/13R-b R-b
10/13R-b R-b
11/13R-b R-b
12/13R-b R-b
13/13R-b R-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 4 reviewers.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/13] bdrv_reopen() overhaul, part 1

This is v2 of the first part of the series "[PATCH 00/34] block: Cache mode for children, reopen overhaul and more". Review of v1 turned up some larger issues that need to be addressed as a prerequisite for some patches (essentially bdrv_swap() removal is needed), so I decided to split the series in multiple parts, even if this means that we commit series with no immediate effect. This series is almost like that.

Quoted 1 line

From the items in the original cover letter, this series still contains:

- A common infrastructure for opening child nodes, so that...
- ...the block layer knows all the children of a BDS now
- ...VMDK allows passing options to individual extents
- A node knows from which other node it inherited flags and options; this is respected when recalculating flags and options for child nodes on bdrv_reopen() (i.e. if the node didn't inherit originally from a parent node, it now doesn't on reopen either)

Left for part 2 and 3 of the split series are:

- You can now use node name references for backing files
- bdrv_reopen() accepts options now (and qcow2 makes use of it)
- And finally you can set cache mode options for backing files and other children now (and the reopen behaviour even makes sense)

Changes in v2:
- Patch 1:
Added a real commit message [Eric]
Fixed function comment [Eric]
Handle overflows [Max]

- Patch 2: Fixed function comment [Eric]

- New patch 3: Added test cases for new QDict functions [Eric]

- Patch 7 (was 6): Fixed opts leak [Max]

- Patch 8 (was 7):
Improved comment [Eric]
Fixed coding style [Max]

- New patches 9 and 10: bdrv_swap() needs to fix up all list heads of non-empty lists in BlockDriverState. Add bdrv_drain() to ensure that the tracked requests list is empty; add a macro for fixing up non-empty lists.

- Patch 11 (was 8):
Fixed bdrv_swap() for bs->children (fix up list head) Remove entries from bs->children list before free()ing them

=== git-backport-diff against v1 ===

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/13:[0020] [FC] 'qdict: Add qdict_array_entries()' 002/13:[0005] [FC] 'qdict: Add qdict_{set,copy}_default()' 003/13:[down] 'check-qdict: Test cases for new functions' 004/13:[----] [--] 'quorum: Use bdrv_open_image()' 005/13:[----] [--] 'vmdk: Use bdrv_open_image()'
006/13:[----] [--] 'block: Use macro for cache option names' 007/13:[0002] [FC] 'block: Use QemuOpts in bdrv_open_common()' 008/13:[down] 'block: Move flag inheritance to bdrv_open_inherit()' 009/13:[down] 'block: Drain requests before swapping nodes in bdrv_swap()' 010/13:[down] 'queue.h: Add QLIST_FIX_HEAD_PTR()' 011/13:[0010] [FC] 'block: Add list of children to BlockDriverState' 012/13:[----] [-C] 'block: Add BlockDriverState.inherits_from' 013/13:[----] [--] 'block: Fix reopen flag inheritance'

(Patch 8 was present before, but the subject line changed.)

Kevin Wolf (13):
qdict: Add qdict_array_entries()
qdict: Add qdict_{set,copy}_default()
check-qdict: Test cases for new functions
quorum: Use bdrv_open_image()
vmdk: Use bdrv_open_image()
block: Use macro for cache option names
block: Use QemuOpts in bdrv_open_common()
block: Move flag inheritance to bdrv_open_inherit()
block: Drain requests before swapping nodes in bdrv_swap() queue.h: Add QLIST_FIX_HEAD_PTR()
block: Add list of children to BlockDriverState
block: Add BlockDriverState.inherits_from
block: Fix reopen flag inheritance

 block.c                   | 186 +++++++++++++++++++++++++++++++++++++++++-----
 block/blkdebug.c          |   2 +-
 block/blkverify.c         |   4 +-
 block/quorum.c            |  51 +++----------
 block/vmdk.c              |  61 ++++++---------
 blockdev.c                |  24 +++---
 include/block/block.h     |  12 ++-
 include/block/block_int.h |  19 +++++
 include/qapi/qmp/qdict.h  |   4 +
 include/qemu/queue.h      |   6 ++
 qobject/qdict.c           | 111 ++++++++++++++++++++++++++-
 tests/check-qdict.c       |  67 +++++++++++++++++
 12 files changed, 428 insertions(+), 119 deletions(-)
Signature · 1 line
1.8.3.1