Skip to content

block: Managing inactive nodes (QSD migration)

Kevin Wolf qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest16 patches 7 repliesIn review
  2. v215 patches 35 repliesSuperseded
  3. v19 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Moved bdrv_is_inactive() to patch 1 to fix the build [Fabiano]
- Patch 5 ('block: Allow inactivating already inactive nodes') has become patch 2 to fix the logical ordering [Eric]
- Patch 8: Fixed typo in the documentation [Eric]
- Patch 10: Fixed typo in the commit message [Stefan]
- Added Patch 11: Drain nodes for setting inactive flag [Stefan]
- Patch 14: Test reading inactive images from both sides [Eric]
- Patch 16: Fix typo in a comment [Eric]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16block: Add 'active' field to BlockDeviceInfoblock.c block/monitor/block-hmp-cmds.c block/qapi.c +5 more+39 -30 replies
2/16block: Allow inactivating already inactive nodesblock.c+12 -40 replies
3/16block: Inactivate external snapshot overlays when necessaryblockdev.c+16 -00 replies
4/16migration/block-active: Remove global active flagmigration/block-active.c migration/migration.c migration/migration.h+0 -570 replies
5/16block: Don't attach inactive child to active nodeblock.c+5 -00 replies
6/16block: Fix crash on block_resize on inactive nodeblock.c block/block-backend.c+8 -10 replies
7/16block: Add option to create inactive nodesblock.c include/block/block-common.h qapi/block-core.json+16 -00 replies
8/16block: Add blockdev-set-active QMP commandblock.c blockdev.c include/block/block-global-state.h +1 more+88 -00 replies
9/16block: Support inactive nodes in blk_insert_bs()block/block-backend.c+12 -20 replies
10/16block/export: Don't ignore image activation error in blk_exp_add()block/export/export.c+5 -10 replies
11/16block: Drain nodes before inactivating themblock.c+2 -01 reply
12/16block/export: Add option to allow export of inactive nodesblock/export/export.c include/block/export.h qapi/block-export.json+33 -110 replies
13/16nbd/server: Support inactive nodesnbd/server.c+17 -01 reply
14/16iotests: Add filter_qtest()tests/qemu-iotests/041 tests/qemu-iotests/165 tests/qemu-iotests/iotests.py +2 more+10 -120 replies
15/16iotests: Add qsd-migrate casetests/qemu-iotests/tests/qsd-migrate tests/qemu-iotests/tests/qsd-migrate.out+199 -03 replies
16/16iotests: Add (NBD-based) tests for inactive nodestests/qemu-iotests/iotests.py tests/qemu-iotests/tests/inactive-node-nbd tests/qemu-iotests/tests/inactive-node-nbd.out+546 -01 reply

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFabiano RosasEric BlakeStefan Hajnoczi
SeriesR-b
1/16A-b R-b R-b
2/16A-b R-b R-b
3/16A-b R-b R-b
4/16A-b R-b R-b
5/16A-b R-b R-b
6/16A-b R-b R-b
7/16A-b R-b R-b
8/16A-b R-b R-b
9/16A-b R-b R-b
10/16A-b R-b R-b
11/16R-b
12/16A-b R-b R-b
13/16R-b
14/16A-b R-b
15/16A-b R-b
16/16R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/16] block: Managing inactive nodes (QSD migration)

This series adds a mechanism that allows the user or management tool to manually activate and inactivate block nodes instead of fully relying on the automatic management in the migration code.

One case where this is needed is for migration with shared storage and devices backed by qemu-storage-daemon, which as an external process is not involved in the VM migration. Management tools can manually orchestrate the handover in this scenario. The new qemu-iotests case qsd-migrate demonstrates this.

There are other cases without qemu-storage-daemon where manual management is necessary. For example, after migration, the destination VM only activates images on 'cont', but after migrating a paused VM, the user may want to perform operations on a block node while the VM is still paused.

This series adds support for block exports on an inactive node (needed for shared storage migration with qemu-storage-daemon) only to NBD. Adding it to other export types will be done in a future series.

v3:
- Moved bdrv_is_inactive() to patch 1 to fix the build [Fabiano]
- Patch 5 ('block: Allow inactivating already inactive nodes') has become patch 2 to fix the logical ordering [Eric]
- Patch 8: Fixed typo in the documentation [Eric]
- Patch 10: Fixed typo in the commit message [Stefan]
- Added Patch 11: Drain nodes for setting inactive flag [Stefan]
- Patch 14: Test reading inactive images from both sides [Eric]
- Patch 16: Fix typo in a comment [Eric]

v2:
- Added a comprehensive test case that tests how inactive nodes interoperate with many operations
- Added a couple of fixes for bugs uncovered by the tests (that would usually lead to crashes when an unsupported operation is performed on inactive nodes)
- Added 'active' status to query-block information

Kevin Wolf (16):
block: Add 'active' field to BlockDeviceInfo
block: Allow inactivating already inactive nodes
block: Inactivate external snapshot overlays when necessary migration/block-active: Remove global active flag
block: Don't attach inactive child to active node
block: Fix crash on block_resize on inactive node
block: Add option to create inactive nodes
block: Add blockdev-set-active QMP command
block: Support inactive nodes in blk_insert_bs() block/export: Don't ignore image activation error in blk_exp_add()
block: Drain nodes before inactivating them block/export: Add option to allow export of inactive nodes nbd/server: Support inactive nodes
iotests: Add filter_qtest()
iotests: Add qsd-migrate case
iotests: Add (NBD-based) tests for inactive nodes

 qapi/block-core.json                          |  44 ++-
 qapi/block-export.json                        |  10 +-
 include/block/block-common.h                  |   1 +
 include/block/block-global-state.h            |   6 +
 include/block/export.h                        |   3 +
 migration/migration.h                         |   3 -
 block.c                                       |  64 +++-
 block/block-backend.c                         |  16 +-
 block/export/export.c                         |  29 +-
 block/monitor/block-hmp-cmds.c                |   5 +-
 block/qapi.c                                  |   1 +
 blockdev.c                                    |  48 +++
 migration/block-active.c                      |  46 ---
 migration/migration.c                         |   8 -
 nbd/server.c                                  |  17 +
 tests/qemu-iotests/iotests.py                 |   8 +
 tests/qemu-iotests/041                        |   4 +-
 tests/qemu-iotests/165                        |   4 +-
 tests/qemu-iotests/184.out                    |   2 +
 tests/qemu-iotests/191.out                    |  16 +
 tests/qemu-iotests/273.out                    |   5 +
 tests/qemu-iotests/tests/copy-before-write    |   3 +-
 tests/qemu-iotests/tests/inactive-node-nbd    | 303 ++++++++++++++++++
 .../qemu-iotests/tests/inactive-node-nbd.out  | 239 ++++++++++++++
 tests/qemu-iotests/tests/migrate-bitmaps-test |   7 +-
 tests/qemu-iotests/tests/qsd-migrate          | 140 ++++++++
 tests/qemu-iotests/tests/qsd-migrate.out      |  59 ++++
 27 files changed, 1004 insertions(+), 87 deletions(-)
 create mode 100755 tests/qemu-iotests/tests/inactive-node-nbd
 create mode 100644 tests/qemu-iotests/tests/inactive-node-nbd.out
 create mode 100755 tests/qemu-iotests/tests/qsd-migrate
 create mode 100644 tests/qemu-iotests/tests/qsd-migrate.out
Signature · 1 line
2.48.1