qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v9 0/7] blockdev-replace
@ 2024-06-26 11:53 Vladimir Sementsov-Ogievskiy
  2024-06-26 11:53 ` [PATCH v9 1/7] block-backend: blk_root(): drop const specifier on return type Vladimir Sementsov-Ogievskiy
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2024-06-26 11:53 UTC (permalink / raw)
  To: qemu-block
  Cc: qemu-devel, pbonzini, armbru, eblake, hreitz, kwolf, vsementsov

Hi all!

This series presents a new command blockdev-replace, which helps to
insert/remove filters anywhere in the block graph. It can:

 - replace qdev block-node by qdev-id
 - replace export block-node by export-id
 - replace any child of parent block-node by node-name and child name

So insertions is done in two steps:

1. blockdev_add (create filter node, unparented)

    [some parent]  [new filter]
     |               |
     V               V
    [        some child       ]

2. blockdev-replace (replace child by the filter)

    [some parent]
     | 
     V
    [new filter]
     |
     V
    [some child]

And removal is done in reverse order:

1. blockdev-replace (go back to picture 1)
2. blockdev_del (remove filter node)


Ideally, we to do both operations (add + replace or replace + del) in a
transaction, but that would be another series.

v9: rebase
    drop x- prefix and use unstable feature
    bump version to 9.1 in qapi spec
    update error message in blk_by_qdev_id stub

v8: rebase. Also don't use "preallocate" filter in a test, as we don't
support removal of this filter for now. Preallocate filter is really
unusual, see discussion here:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg994945.html

Vladimir Sementsov-Ogievskiy (7):
  block-backend: blk_root(): drop const specifier on return type
  block/export: add blk_by_export_id()
  block: make bdrv_find_child() function public
  qapi: add blockdev-replace command
  block: bdrv_get_xdbg_block_graph(): report export ids
  iotests.py: introduce VM.assert_edges_list() method
  iotests: add filter-insertion

 block.c                                       |  17 ++
 block/block-backend.c                         |   2 +-
 block/export/export.c                         |  31 +++
 blockdev.c                                    |  70 ++++--
 include/block/block_int-io.h                  |   2 +
 include/block/export.h                        |   1 +
 include/sysemu/block-backend-global-state.h   |   3 +-
 qapi/block-core.json                          |  88 +++++++
 stubs/blk-by-qdev-id.c                        |  13 +
 stubs/blk-exp-find-by-blk.c                   |   9 +
 stubs/meson.build                             |   2 +
 tests/qemu-iotests/iotests.py                 |  17 ++
 tests/qemu-iotests/tests/filter-insertion     | 236 ++++++++++++++++++
 tests/qemu-iotests/tests/filter-insertion.out |   5 +
 14 files changed, 480 insertions(+), 16 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/filter-insertion
 create mode 100644 tests/qemu-iotests/tests/filter-insertion.out

-- 
2.34.1



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

end of thread, other threads:[~2025-04-02 13:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-26 11:53 [PATCH v9 0/7] blockdev-replace Vladimir Sementsov-Ogievskiy
2024-06-26 11:53 ` [PATCH v9 1/7] block-backend: blk_root(): drop const specifier on return type Vladimir Sementsov-Ogievskiy
2024-06-26 11:53 ` [PATCH v9 2/7] block/export: add blk_by_export_id() Vladimir Sementsov-Ogievskiy
2024-07-18 11:48   ` Markus Armbruster
2024-07-19 10:59     ` Vladimir Sementsov-Ogievskiy
2024-06-26 11:53 ` [PATCH v9 3/7] block: make bdrv_find_child() function public Vladimir Sementsov-Ogievskiy
2024-06-26 11:53 ` [PATCH v9 4/7] qapi: add blockdev-replace command Vladimir Sementsov-Ogievskiy
2024-07-18 12:00   ` Markus Armbruster
2024-07-19 16:00     ` Vladimir Sementsov-Ogievskiy
2024-10-02 14:41   ` Vladimir Sementsov-Ogievskiy
2024-10-04 17:01     ` Vladimir Sementsov-Ogievskiy
2024-10-18 13:59       ` Kevin Wolf
2025-04-02 13:05         ` Vladimir Sementsov-Ogievskiy
2024-06-26 11:53 ` [PATCH v9 5/7] block: bdrv_get_xdbg_block_graph(): report export ids Vladimir Sementsov-Ogievskiy
2024-06-26 11:53 ` [PATCH v9 6/7] iotests.py: introduce VM.assert_edges_list() method Vladimir Sementsov-Ogievskiy
2024-06-26 11:53 ` [PATCH v9 7/7] iotests: add filter-insertion Vladimir Sementsov-Ogievskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).