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.
>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(-) -- 1.8.3.1