All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/45] Transactional block-graph modifying API
@ 2022-03-30 21:28 Vladimir Sementsov-Ogievskiy
  2022-03-30 21:28 ` [PATCH v5 01/45] block: BlockDriver: add .filtered_child_is_backing field Vladimir Sementsov-Ogievskiy
                   ` (44 more replies)
  0 siblings, 45 replies; 78+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2022-03-30 21:28 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, hreitz, vsementsov, v.sementsov-og, qemu-devel

Hi all!

v5: rebased on master, sorry for the noise

That's a big series, which unites some of my previous ones, and
completes them with necessary additions to finally implement block-graph
modifying API. The series is called "v4" as it inherits
"[PATCH v3 00/11] blockdev-replace" (among other things).

After this series, we have blockdev-add, blockdev-del and
x-blockdev-replace transaction actions, which allows to insert and
remove filters.

Additional challenge is to avoid intermediate permission update. That's
and existing paradigm of block graph modifications: first do all the
modifications and then refresh the permissions. Now we should bring this
paradigm to block-graph modifying transactions: if several graph
modifying commands are sequential in one transaction, permission are
updated after the last of these commands. The application of this is
possibility to correct copy-before-write filter permission requirements
(see last patch).

I now unite all these things into one series because:
 - they depend on each other and I have to rebase them together when
 something needs fix or refactoring
 - just to resend with my new email address
If needed, parts may go in separate, and I can split them again if
necessary.

So, what is here:

1. "[PATCH 00/14] block: cleanup backing and file handling" series,
unchanged:

  block: BlockDriver: add .filtered_child_is_backing field
  block: introduce bdrv_open_file_child() helper
  block/blklogwrites: don't care to remove bs->file child on failure
  test-bdrv-graph-mod: update test_parallel_perm_update test case
  tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing
  test-bdrv-graph-mod: fix filters to be filters
  block: document connection between child roles and
    bs->backing/bs->file
  block/snapshot: stress that we fallback to primary child
  Revert "block: Let replace_child_noperm free children"
  Revert "block: Let replace_child_tran keep indirect pointer"
  Revert "block: Restructure remove_file_or_backing_child()"
  Revert "block: Pass BdrvChild ** to replace_child_noperm"
  block: Manipulate bs->file / bs->backing pointers in .attach/.detach
  block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr

2. implement bdrv_unref_tran() - the key thing to implement blockdev-del
transaction action later.
This part inherits from "[PATCH 00/14] block: blockdev-del force=false".
Still force=false is not realized and qcow2 is untouched, as the target
now is transactional removement.

  block: refactor bdrv_remove_file_or_backing_child to bdrv_remove_child
  block: drop bdrv_detach_child()
  block: drop bdrv_remove_filter_or_cow_child
  block: bdrv_refresh_perms(): allow external tran
  block: refactor bdrv_list_refresh_perms to allow any list of nodes
  block: make permission update functions public
  block: add bdrv_try_set_aio_context_tran transaction action
  block: implemet bdrv_unref_tran()

3. Move blockdev.c transactions to util/transactions.c API.

  blockdev: refactor transaction to use Transaction API
  blockdev: transactions: rename some things
  blockdev: qmp_transaction: refactor loop to classic for
  blockdev: transaction: refactor handling transaction properties
  blockdev: qmp_transaction: drop extra generic layer

4. add blockdev-del transaction action

  qapi: block: add blockdev-del transaction action

5. add blockdev-add transaction action
(inherits from "[PATCH 0/2] blockdev-add transaction")

  block: introduce BDRV_O_NOPERM flag
  block: bdrv_insert_node(): use BDRV_O_NOPERM
  qapi: block: add blockdev-add transaction action
  iotests: add blockdev-add-transaction

6. add x-blockdev-replace command and transaction action
(inherits from "[PATCH v3 00/11] blockdev-replace")

  block-backend: blk_root(): drop const specifier on return type
  block/export: add blk_by_export_id()
  block: make bdrv_find_child() function public
  block: bdrv_replace_child_bs(): move to external transaction
  qapi: add x-blockdev-replace command
  qapi: add x-blockdev-replace transaction action
  block: bdrv_get_xdbg_block_graph(): report export ids
  iotests.py: qemu_img_create: use imgfmt by default
  iotests.py: introduce VM.assert_edges_list() method
  iotests.py: add VM.qmp_check() helper
  iotests: add filter-insertion

7. Correct permission scheme of copy-before-write filter, with help of
new design of graph-modifying API.

  block: bdrv_open_inherit: create BlockBackend only when necessary
  block/copy-before-write: correct permission scheme

 block.c                                       | 871 ++++++++++--------
 block/blkdebug.c                              |   9 +-
 block/blklogwrites.c                          |  11 +-
 block/blkreplay.c                             |   7 +-
 block/blkverify.c                             |   9 +-
 block/block-backend.c                         |  11 +-
 block/bochs.c                                 |   7 +-
 block/cloop.c                                 |   7 +-
 block/commit.c                                |   1 +
 block/copy-before-write.c                     |  24 +-
 block/copy-on-read.c                          |   9 +-
 block/crypto.c                                |  11 +-
 block/dmg.c                                   |   7 +-
 block/export/export.c                         |  31 +
 block/filter-compress.c                       |   6 +-
 block/mirror.c                                |   1 +
 block/monitor/block-hmp-cmds.c                |   2 +-
 block/parallels.c                             |   7 +-
 block/preallocate.c                           |   9 +-
 block/qcow.c                                  |   6 +-
 block/qcow2.c                                 |   8 +-
 block/qed.c                                   |   8 +-
 block/raw-format.c                            |   4 +-
 block/replication.c                           |   8 +-
 block/snapshot.c                              |  60 +-
 block/throttle.c                              |   8 +-
 block/vdi.c                                   |   7 +-
 block/vhdx.c                                  |   7 +-
 block/vmdk.c                                  |   7 +-
 block/vpc.c                                   |   7 +-
 blockdev.c                                    | 842 +++++++++--------
 include/block/block-common.h                  |  47 +-
 include/block/block-global-state.h            |  24 +-
 include/block/block_int-common.h              |  36 +-
 include/block/block_int-global-state.h        |   3 +-
 include/block/block_int-io.h                  |   1 +
 include/block/export.h                        |   1 +
 include/sysemu/block-backend-global-state.h   |   3 +-
 qapi/block-core.json                          |  73 +-
 qapi/transaction.json                         |  35 +-
 stubs/blk-by-qdev-id.c                        |   9 +
 stubs/blk-exp-find-by-blk.c                   |   9 +
 stubs/meson.build                             |   2 +
 tests/qemu-iotests/iotests.py                 |  23 +
 .../tests/blockdev-add-transaction            |  52 ++
 .../tests/blockdev-add-transaction.out        |   6 +
 tests/qemu-iotests/tests/filter-insertion     | 253 +++++
 tests/qemu-iotests/tests/filter-insertion.out |   5 +
 tests/qemu-iotests/tests/image-fleecing       |  20 +-
 tests/qemu-iotests/tests/image-fleecing.out   |   8 -
 tests/unit/test-bdrv-drain.c                  |  11 +-
 tests/unit/test-bdrv-graph-mod.c              |  94 +-
 52 files changed, 1725 insertions(+), 1002 deletions(-)
 create mode 100644 stubs/blk-by-qdev-id.c
 create mode 100644 stubs/blk-exp-find-by-blk.c
 create mode 100755 tests/qemu-iotests/tests/blockdev-add-transaction
 create mode 100644 tests/qemu-iotests/tests/blockdev-add-transaction.out
 create mode 100755 tests/qemu-iotests/tests/filter-insertion
 create mode 100644 tests/qemu-iotests/tests/filter-insertion.out

-- 
2.35.1



^ permalink raw reply	[flat|nested] 78+ messages in thread

end of thread, other threads:[~2022-06-21 12:12 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 21:28 [PATCH v5 00/45] Transactional block-graph modifying API Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 01/45] block: BlockDriver: add .filtered_child_is_backing field Vladimir Sementsov-Ogievskiy
2022-06-07  9:57   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 02/45] block: introduce bdrv_open_file_child() helper Vladimir Sementsov-Ogievskiy
2022-06-07  9:57   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 03/45] block/blklogwrites: don't care to remove bs->file child on failure Vladimir Sementsov-Ogievskiy
2022-06-07 10:05   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 04/45] test-bdrv-graph-mod: update test_parallel_perm_update test case Vladimir Sementsov-Ogievskiy
2022-06-07 10:53   ` Hanna Reitz
2022-06-09 13:08     ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 05/45] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing Vladimir Sementsov-Ogievskiy
2022-06-07 10:59   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 06/45] test-bdrv-graph-mod: fix filters to be filters Vladimir Sementsov-Ogievskiy
2022-06-07 11:22   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 07/45] block: document connection between child roles and bs->backing/bs->file Vladimir Sementsov-Ogievskiy
2022-06-07 12:11   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 08/45] block/snapshot: stress that we fallback to primary child Vladimir Sementsov-Ogievskiy
2022-06-07 13:42   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 09/45] Revert "block: Let replace_child_noperm free children" Vladimir Sementsov-Ogievskiy
2022-06-07 14:03   ` Hanna Reitz
2022-06-07 15:09     ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 10/45] Revert "block: Let replace_child_tran keep indirect pointer" Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 11/45] Revert "block: Restructure remove_file_or_backing_child()" Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 12/45] Revert "block: Pass BdrvChild ** to replace_child_noperm" Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 13/45] block: Manipulate bs->file / bs->backing pointers in .attach/.detach Vladimir Sementsov-Ogievskiy
2022-06-07 15:55   ` Hanna Reitz
2022-06-09 13:40     ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 14/45] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr Vladimir Sementsov-Ogievskiy
2022-06-07 15:58   ` Hanna Reitz
2022-06-09 14:44     ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 15/45] block: refactor bdrv_remove_file_or_backing_child to bdrv_remove_child Vladimir Sementsov-Ogievskiy
2022-06-08 10:04   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 16/45] block: drop bdrv_detach_child() Vladimir Sementsov-Ogievskiy
2022-06-08 10:22   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 17/45] block: drop bdrv_remove_filter_or_cow_child Vladimir Sementsov-Ogievskiy
2022-06-08 10:40   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 18/45] block: bdrv_refresh_perms(): allow external tran Vladimir Sementsov-Ogievskiy
2022-06-08 10:57   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 19/45] block: refactor bdrv_list_refresh_perms to allow any list of nodes Vladimir Sementsov-Ogievskiy
2022-06-08 11:27   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 20/45] block: make permission update functions public Vladimir Sementsov-Ogievskiy
2022-06-08 11:31   ` Hanna Reitz
2022-03-30 21:28 ` [PATCH v5 21/45] block: add bdrv_try_set_aio_context_tran transaction action Vladimir Sementsov-Ogievskiy
2022-06-08 11:49   ` Hanna Reitz
2022-06-09 14:56     ` Vladimir Sementsov-Ogievskiy
2022-06-13  7:12       ` Hanna Reitz
2022-06-13  7:46   ` Hanna Reitz
2022-06-20 20:57     ` Vladimir Sementsov-Ogievskiy
2022-06-21 11:04       ` Hanna Reitz
2022-06-21 11:44         ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 22/45] block: implemet bdrv_unref_tran() Vladimir Sementsov-Ogievskiy
2022-06-13  9:07   ` Hanna Reitz
2022-06-20 21:16     ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 23/45] blockdev: refactor transaction to use Transaction API Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 24/45] blockdev: transactions: rename some things Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 25/45] blockdev: qmp_transaction: refactor loop to classic for Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 26/45] blockdev: transaction: refactor handling transaction properties Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 27/45] blockdev: qmp_transaction: drop extra generic layer Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 28/45] qapi: block: add blockdev-del transaction action Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 29/45] block: introduce BDRV_O_NOPERM flag Vladimir Sementsov-Ogievskiy
2022-06-13  9:54   ` Hanna Reitz
2022-06-21 12:11     ` Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 30/45] block: bdrv_insert_node(): use BDRV_O_NOPERM Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 31/45] qapi: block: add blockdev-add transaction action Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 32/45] iotests: add blockdev-add-transaction Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 33/45] block-backend: blk_root(): drop const specifier on return type Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 34/45] block/export: add blk_by_export_id() Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 35/45] block: make bdrv_find_child() function public Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 36/45] block: bdrv_replace_child_bs(): move to external transaction Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 37/45] qapi: add x-blockdev-replace command Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 38/45] qapi: add x-blockdev-replace transaction action Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 39/45] block: bdrv_get_xdbg_block_graph(): report export ids Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 40/45] iotests.py: qemu_img_create: use imgfmt by default Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 41/45] iotests.py: introduce VM.assert_edges_list() method Vladimir Sementsov-Ogievskiy
2022-03-30 21:28 ` [PATCH v5 42/45] iotests.py: add VM.qmp_check() helper Vladimir Sementsov-Ogievskiy
2022-03-30 21:29 ` [PATCH v5 43/45] iotests: add filter-insertion Vladimir Sementsov-Ogievskiy
2022-03-30 21:29 ` [PATCH v5 44/45] block: bdrv_open_inherit: create BlockBackend only when necessary Vladimir Sementsov-Ogievskiy
2022-03-30 21:29 ` [PATCH v5 45/45] block/copy-before-write: correct permission scheme Vladimir Sementsov-Ogievskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.