RFC New op blocker system
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest41 patches 33 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/41 | block: Attach bs->file only during .bdrv_open()block.c block/ block/ +14 more | +129 | 1 reply | |
| 2/41 | block: Add op blocker permission constantsinclude/ | +34 | 0 replies | |
| 3/41 | block: Add Error argument to bdrv_attach_child()block.c block/ include/ | +19 | 1 reply | |
| 4/41 | block: Let callers request permissions when attaching a child nodeblock.c block/ include/ | +78 | 0 replies | |
| 5/41 | tests: Use opened block node for block job teststests/ tests/ | +10 | 0 replies | |
| 6/41 | block: Involve block drivers in permission grantingblock.c include/ | +171 | 3 replies | |
| 7/41 | block: Default .bdrv_child_perm() for filter driversblock.c include/ | +32 | 1 reply | |
| 8/41 | block: Request child permissions in filter driversblock/ block/ block/ +3 more | +8 | 0 replies | |
| 9/41 | block: Default .bdrv_child_perm() for format driversblock.c include/ | +45 | 6 replies | |
| 10/41 | block: Request child permissions in format driversblock/ block/ block/ +9 more | +12 | 1 reply | |
| 11/41 | vvfat: Implement .bdrv_child_perm()block/ | +13 | 2 replies | |
| 12/41 | block: Require .bdrv_child_perm() with child nodesblock.c | +4 | 0 replies | |
| 13/41 | block: Request real permissions in bdrv_attach_child()block.c | +15 | 1 reply | |
| 14/41 | block: Add permissions to BlockBackendblock/ include/ | +29 | 1 reply | |
| 15/41 | block: Add permissions to blk_new()block/ block/ block/ +13 more | +42 | 1 reply | |
| 16/41 | block: Add error parameter to blk_insert_bs()block/ block/ block/ +9 more | +84 | 4 replies | |
| 17/41 | block: Request real permissions in blk_new_open()block/ | +14 | 1 reply | |
| 18/41 | block: Allow error return in BlockDevOps.change_media_cb()block/ blockdev.c hw/ +5 more | +30 | 1 reply | |
| 19/41 | hw/block: Request permissionshw/ hw/ hw/ +14 more | +137 | 2 replies | |
| 20/41 | hw/block: Introduce share-rw qdev propertyhw/ include/ tests/ | +64 | 3 replies | |
| 21/41 | blockjob: Add permissions to block_job_create()block/ block/ block/ +5 more | +24 | 0 replies | |
| 22/41 | block: Add BdrvChildRole.get_link_name()block.c block/ include/ | +32 | 1 reply | |
| 23/41 | block: Include details on permission errors in messageblock.c | +55 | 1 reply | |
| 24/41 | block: Add BdrvChildRole.stay_at_nodeblock.c include/ | +7 | 0 replies | |
| 25/41 | blockjob: Add permissions to block_job_add_bdrv()block/ block/ block/ +3 more | +38 | 1 reply | |
| 26/41 | block: Factor out bdrv_open_driver()block.c | +65 | 0 replies | |
| 27/41 | block: Add bdrv_new_open_driver()block.c include/ | +32 | 1 reply | |
| 28/41 | commit: Use real permissions in commit block jobblock/ | +89 | 0 replies | |
| 29/41 | commit: Use real permissions for HMP 'commit'block/ | +26 | 0 replies | |
| 30/41 | backup: Use real permissions in backup block jobblock/ tests/ | +17 | 0 replies | |
| 31/41 | block: Fix pending requests check in bdrv_append()block.c | +2 | 0 replies | |
| 32/41 | block: BdrvChildRole.attach/detach() callbacksblock.c include/ | +62 | 0 replies | |
| 33/41 | block: Allow backing file links in change_parent_backing_link()block.c | +3 | 0 replies | |
| 34/41 | mirror: Use real permissions in mirror/active commit block jobblock/ qemu-img.c tests/ +1 more | +143 | 0 replies | |
| 35/41 | stream: Use real permissions in streaming block jobblock/ | +26 | 0 replies | |
| 36/41 | hmp: Request permissions in qemu-ioblock/ hmp.c include/ +2 more | +61 | 0 replies | |
| 37/41 | migration/block: Use real permissionsmigration/ | +16 | 0 replies | |
| 38/41 | nbd/server: Use real permissions for NBD exportsnbd/ | +9 | 0 replies | |
| 39/41 | tests: Remove FIXME commentstests/ tests/ | +2 | 0 replies | |
| 40/41 | block: Pass BdrvChild to bdrv_aligned_preadv/pwritevblock/ | +17 | 0 replies | |
| 41/41 | block: Assertions for write permissionsblock/ | +7 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [RFC PATCH 00/41] New op blocker system
This series is a first rough attempt at implementing the new op blocker system whose design was agreed on quite a while ago, but proved a bit tricky to implement in places. There is still work left to do, but if we want to get this (or the greatest part of it) into 2.9, it's probably time to start review and discussion.
The basic idea is that every user of a block node (including things outside the block layer that go through a BlockBackend, and also other block nodes that hold references to it) has to declare which low-level operations/permissions it needs and which operation it allows other users to perform on the same node. Depending on these declarations, conflicts are avoided by returning an error for attempts to attach a conflicting user to the same node.
After this series, all users request permissions, and hopefully all of the permissions they need. For a subset of them, getting the permission first is actually enforced with assertions. We can probably add more assertions to this.
The series doesn't remove the old op blockers yet, though in theory the new op blockers should block everything they used to block. (In practice it's not completely true yet, some monitor commands don't get the right permissions yet, in particular related to resize/graph modification.)
Kevin Wolf (41):
block: Attach bs->file only during .bdrv_open()
block: Add op blocker permission constants
block: Add Error argument to bdrv_attach_child()
block: Let callers request permissions when attaching a child node
tests: Use opened block node for block job tests
block: Involve block drivers in permission granting
block: Default .bdrv_child_perm() for filter drivers
block: Request child permissions in filter drivers
block: Default .bdrv_child_perm() for format drivers
block: Request child permissions in format drivers
vvfat: Implement .bdrv_child_perm()
block: Require .bdrv_child_perm() with child nodes
block: Request real permissions in bdrv_attach_child()
block: Add permissions to BlockBackend
block: Add permissions to blk_new()
block: Add error parameter to blk_insert_bs()
block: Request real permissions in blk_new_open()
block: Allow error return in BlockDevOps.change_media_cb() hw/block: Request permissions
hw/block: Introduce share-rw qdev property
blockjob: Add permissions to block_job_create()
block: Add BdrvChildRole.get_link_name()
block: Include details on permission errors in message
block: Add BdrvChildRole.stay_at_node
blockjob: Add permissions to block_job_add_bdrv()
block: Factor out bdrv_open_driver()
block: Add bdrv_new_open_driver()
commit: Use real permissions in commit block job
commit: Use real permissions for HMP 'commit'
backup: Use real permissions in backup block job
block: Fix pending requests check in bdrv_append()
block: BdrvChildRole.attach/detach() callbacks
block: Allow backing file links in change_parent_backing_link()
mirror: Use real permissions in mirror/active commit block job
stream: Use real permissions in streaming block job
hmp: Request permissions in qemu-io
migration/block: Use real permissions
nbd/server: Use real permissions for NBD exports
tests: Remove FIXME comments
block: Pass BdrvChild to bdrv_aligned_preadv/pwritev
block: Assertions for write permissions
block.c | 615 ++++++++++++++++++++++++++++++++------- block/backup.c | 21 +- block/blkdebug.c | 2 + block/blkreplay.c | 1 + block/blkverify.c | 1 + block/block-backend.c | 95 +++++- block/bochs.c | 7 + block/cloop.c | 7 + block/commit.c | 164 +++++++++-- block/crypto.c | 7 + block/dmg.c | 7 + block/io.c | 40 ++- block/mirror.c | 160 ++++++++-- block/parallels.c | 7 + block/qcow.c | 7 + block/qcow2.c | 19 +- block/qed.c | 19 +- block/quorum.c | 10 +- block/raw-format.c | 7 + block/replication.c | 7 + block/stream.c | 36 ++- block/vdi.c | 7 + block/vhdx.c | 7 + block/vmdk.c | 7 + block/vpc.c | 7 + block/vvfat.c | 13 + blockdev.c | 27 +- blockjob.c | 39 ++- hmp.c | 33 ++- hw/block/block.c | 21 +- hw/block/fdc.c | 28 +- hw/block/m25p80.c | 8 + hw/block/nand.c | 7 + hw/block/nvme.c | 8 +- hw/block/onenand.c | 7 + hw/block/pflash_cfi01.c | 18 +- hw/block/pflash_cfi02.c | 19 +- hw/block/virtio-blk.c | 8 +- hw/core/qdev-properties-system.c | 9 +- hw/ide/core.c | 2 +- hw/ide/qdev.c | 8 +- hw/nvram/spapr_nvram.c | 8 + hw/scsi/scsi-disk.c | 11 +- hw/sd/sd.c | 8 +- hw/usb/dev-storage.c | 6 +- include/block/block.h | 5 +- include/block/block_int.h | 124 +++++++- include/block/blockjob.h | 4 +- include/block/blockjob_int.h | 4 +- include/hw/block/block.h | 7 +- include/qemu-io.h | 1 + include/sysemu/block-backend.h | 9 +- migration/block.c | 20 +- nbd/server.c | 16 +- qemu-img.c | 6 +- qemu-io-cmds.c | 28 ++ tests/qemu-iotests/051.out | 4 +- tests/qemu-iotests/051.pc.out | 10 +- tests/qemu-iotests/055 | 11 +- tests/qemu-iotests/141 | 2 +- tests/qemu-iotests/141.out | 4 +- tests/qemu-iotests/172.out | 53 ++++ tests/test-blockjob-txn.c | 12 +- tests/test-blockjob.c | 16 +- tests/test-throttle.c | 7 +- 65 files changed, 1616 insertions(+), 282 deletions(-)
Signature · 1 line
1.8.3.1