blockdev: Further BlockBackend work
Status from this message: Thanks, applied to the block branch.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest17 patches 2 repliesApplied
- v314 patches 24 repliesSuperseded
- v28 patches 8 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 9 patches | 0 replies | Superseded |
Changes in v4 from the cover letter
- Tightly tied a BB's name to the monitor reference [Kevin]
- Added two patches from my "blockdev: (Nearly) free clean-up work" series which are required so a BB does not need to have a name when bdrv_open() is invoked for its BDS tree
- Added a missing monitor_remove_blk() to the error path of hmp_drive_add() [Kevin]
- v3 just made blk_backends contain all BBs and then added another list called monitor_block_backends. v4 instead renames blk_backends to monitor_block_backends (because both are supposed to be the same, basically) and then adds a new list containing all BBs. [Markus/Kevin]
- blk_hide_on_behalf_of_hmp_drive_del() does a bit more than what monitor_remove_blk() does; namely, it invokes bdrv_make_anon() on the BDS. We should probably continue to do so.
- Use blk_is_inserted() instead of blk_is_available() for blk_commit_all() [Kevin]
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | monitor: Use BB list for BB name completionmonitor.c | +4 | 0 replies | |
| 2/17 | block: Use blk_next() in block-backend.cblock/ | +6 | 0 replies | |
| 3/17 | block: Add blk_commit_all()block/ include/ | +6 | 0 replies | |
| 4/17 | block: Use blk_{commit, flush}_all() consistentlyblockdev.c cpus.c qemu-char.c | +6 | 0 replies | |
| 5/17 | qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATUREblock/ block/ block/ +3 more | +18 | 0 replies | |
| 6/17 | block: Drop BB name from bad option errorblock.c tests/ tests/ | +11 | 0 replies | |
| 7/17 | blockdev: Rename blk_backendsblock/ | +11 | 0 replies | |
| 8/17 | blockdev: Add list of all BlockBackendsblock/ | +23 | 0 replies | |
| 9/17 | blockdev: Separate BB name managementblock/ include/ | +63 | 0 replies | |
| 10/17 | blockdev: Split monitor reference from BB creationblock/ block/ block/ +15 more | +68 | 0 replies | |
| 11/17 | blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del()block/ blockdev.c include/ | +6 | 0 replies | |
| 12/17 | block: Move some bdrv_*_all() functions to BBblock.c block/ block/ +3 more | +41 | 0 replies | |
| 13/17 | block: Add bdrv_next_monitor_owned()blockdev.c include/ stubs/ +1 more | +17 | 0 replies | |
| 14/17 | block: Add blk_next_root_bs()block/ include/ | +25 | 0 replies | |
| 15/17 | block: Rewrite bdrv_next()block.c | +14 | 0 replies | |
| 16/17 | block: Use bdrv_next() instead of bdrv_statesblock.c | +6 | 0 replies | |
| 17/17 | block: Remove bdrv_states listblock.c blockdev.c include/ +1 more | +3 | 0 replies |
Reviews trailers per patch
5 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Kevin Wolf |
|---|---|
| 1/17 | |
| 2/17 | |
| 3/17 | R-b |
| 4/17 | R-b |
| 5/17 | |
| 6/17 | |
| 7/17 | |
| 8/17 | |
| 9/17 | |
| 10/17 | |
| 11/17 | |
| 12/17 | |
| 13/17 | |
| 14/17 | |
| 15/17 | R-b |
| 16/17 | R-b |
| 17/17 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [Qemu-devel] [PATCH v4 00/17] blockdev: Further BlockBackend work
This series appears to reinvent itself with every revision. This time, its main implication is that BBs are no longer automatically treated as monitor-owned, and that a BB's name is tightly tied to the monitor reference (it is considered equivalent to that reference).
v4:
- Tightly tied a BB's name to the monitor reference [Kevin]
- Added two patches from my "blockdev: (Nearly) free clean-up work" series which are required so a BB does not need to have a name when bdrv_open() is invoked for its BDS tree
- Added a missing monitor_remove_blk() to the error path of hmp_drive_add() [Kevin]
- v3 just made blk_backends contain all BBs and then added another list called monitor_block_backends. v4 instead renames blk_backends to monitor_block_backends (because both are supposed to be the same, basically) and then adds a new list containing all BBs. [Markus/Kevin]
- blk_hide_on_behalf_of_hmp_drive_del() does a bit more than what monitor_remove_blk() does; namely, it invokes bdrv_make_anon() on the BDS. We should probably continue to do so.
- Use blk_is_inserted() instead of blk_is_available() for blk_commit_all() [Kevin]
Patch justifications:
- 1: General clean-up.
- 2: Clean-up which is nice to have for patch 7 which renames blk_backends to monitor_block_backends.
- 3: In order to move bdrv_commit_all() to the BB level (patch 12), first we need to introduce a BB-level function...
- 4: ...and then we have to use it.
- 5: After this series, BBs will no longer have a name before monitor_add_blk() is called; therefore, we should not try to print the device name when an image is opened (the filename is more interesting anyway)
- 6: Similarily to patch 5, this removes the device name from an error message emitted during image opening.
- 7: blk_backends to me personally implies this was a list of all BlockBackends. It actually is not. Therefore, this patch renames it to a more precise monitor_block_backends.
- 8: As this series makes it more clear that not all BlockBackends need to be referenced by the monitor, this patch consequently adds a list of truly and unconditionally all BlockBackends for whenever we need to iterate through really all of them.
- 9: This patch moves the name management for BlockBackends from blk_new(), blk_delete() and blk_hide_on_behalf_of_hmp_drive_del() into new functions monitor_add_blk() and monitor_remove_blk(). These functions are still invoked in blk_new() etc., so nothing changes to the outside yet.
- 10: This patch drops the implicit calls of monitor_add_blk() and monitor_remove_blk() and thus makes the distinction between a BB's existence and whether it is owned by the monitor externally visible.
- 11: Clean-up patch.
- 12: More or less a clean-up patch.
- 13: Required so we can drop bdrv_states.
- 14: Required so we can drop bdrv_states.
- 15: Required so we can drop bdrv_states.
- 16: Clean-up and required so we can drop bdrv_states.
- 17: Clean-up and preparation for the follow-up series.
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/17:[----] [--] 'monitor: Use BB list for BB name completion' 002/17:[down] 'block: Use blk_next() in block-backend.c' 003/17:[----] [--] 'block: Add blk_commit_all()'
004/17:[----] [--] 'block: Use blk_{commit,flush}_all() consistently' 005/17:[down] 'qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE' 006/17:[down] 'block: Drop BB name from bad option error' 007/17:[down] 'blockdev: Rename blk_backends'
008/17:[down] 'blockdev: Add list of all BlockBackends' 009/17:[down] 'blockdev: Separate BB name management' 010/17:[down] 'blockdev: Split monitor reference from BB creation' 011/17:[0014] [FC] 'blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del()' 012/17:[0002] [FC] 'block: Move some bdrv_*_all() functions to BB' 013/17:[0002] [FC] 'block: Add bdrv_next_monitor_owned()' 014/17:[----] [-C] 'block: Add blk_next_root_bs()' 015/17:[----] [--] 'block: Rewrite bdrv_next()'
016/17:[----] [--] 'block: Use bdrv_next() instead of bdrv_states' 017/17:[----] [-C] 'block: Remove bdrv_states list'
Max Reitz (17):
monitor: Use BB list for BB name completion
block: Use blk_next() in block-backend.c
block: Add blk_commit_all()
block: Use blk_{commit,flush}_all() consistently
qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE
block: Drop BB name from bad option error
blockdev: Rename blk_backends
blockdev: Add list of all BlockBackends
blockdev: Separate BB name management
blockdev: Split monitor reference from BB creation
blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del()
block: Move some bdrv_*_all() functions to BB
block: Add bdrv_next_monitor_owned()
block: Add blk_next_root_bs()
block: Rewrite bdrv_next()
block: Use bdrv_next() instead of bdrv_states
block: Remove bdrv_states list
block.c | 86 +++-------
block/block-backend.c | 228 ++++++++++++++++++--------
block/io.c | 20 ---
block/parallels.c | 2 +-
block/qcow.c | 8 +-
block/qcow2.c | 30 +---
block/qed.c | 9 +-
block/sheepdog.c | 4 +-
block/vdi.c | 2 +-
block/vhdx.c | 2 +-
block/vmdk.c | 13 +-
block/vpc.c | 2 +-
blockdev.c | 44 +++--
cpus.c | 5 +-
device-hotplug.c | 4 +-
hw/block/xen_disk.c | 2 +-
include/block/block.h | 4 +-
include/block/block_int.h | 4 -
include/qapi/qmp/qerror.h | 3 -
include/sysemu/block-backend.h | 15 +-
monitor.c | 7 +-
qemu-char.c | 3 +-
qemu-img.c | 50 +++---
qemu-io.c | 2 +-
qemu-nbd.c | 4 +-
stubs/Makefile.objs | 3 +-
stubs/bdrv-next-monitor-owned.c | 8 +
stubs/{bdrv-commit-all.c => blk-commit-all.c} | 4 +-
tests/qemu-iotests/036.out | 16 +-
tests/qemu-iotests/051.out | 8 +-
tests/qemu-iotests/051.pc.out | 8 +-
tests/qemu-iotests/087.out | 2 +-
32 files changed, 310 insertions(+), 292 deletions(-)
create mode 100644 stubs/bdrv-next-monitor-owned.c
rename stubs/{bdrv-commit-all.c => blk-commit-all.c} (53%)Signature · 1 line
2.7.3