Skip to content

Add a 'x-blockdev-reopen' QMP command

Alberto Garcia qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/213 patches 6 repliesIn review
  2. v2 RFC posting 1/212 patches 1 replySuperseded
  3. v1 RFC10 patches 13 repliesSuperseded

Changes in v2 from the cover letter

- Patch 1: Update documentation, fix check in bdrv_drop_intermediate() and add a new one in bdrv_replace_node() [Kevin]
- Patch 2: Add a missing unfreeze call if commit_start() fails, and prevent a double unfreeze in commit_abort() [Kevin]
- Patch 4: Prevent double unfreeze in stream_abort() [Kevin]
- Patch 6: Update documentation and don't complain for a missing 'backing' option if the driver does not support backing files [Kevin]
- Patch 7: Contextual differences due to changes in previous patches.
- Patch 8: Forbid changing the backing file if there are implicit nodes on the way. Simplify code and update the permission checks to handle a new backing file [Kevin, Berto]
- Patch 9: Remove BlockDriver.runtime_opts from the previous version and use only mutable_opts [Kevin]
- Patch 10: Compare bs->options with reopen_state->options to see what options the user is trying to reset [Kevin]
- Patch 13: Update the tests to reflect all the new changes.

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13block: Allow freezing BdrvChild linksblock.c include/block/block.h include/block/block_int.h+87 -00 replies
2/13block: Freeze the backing chain for the duration of the commit jobblock/commit.c+16 -00 replies
3/13block: Freeze the backing chain for the duration of the mirror jobblock/mirror.c+8 -00 replies
4/13block: Freeze the backing chain for the duration of the stream jobblock/stream.c+21 -00 replies
5/13block: Add 'keep_old_opts' parameter to bdrv_reopen_queue()block.c block/replication.c include/block/block.h +1 more+24 -190 replies
6/13block: Handle child references in bdrv_reopen_queue()block.c include/block/block.h+46 -70 replies
7/13block: Allow omitting the 'backing' option in certain casesblock.c+7 -10 replies
8/13block: Allow changing the backing file on reopenblock.c include/block/block.h+164 -00 replies
9/13block: Add a 'mutable_opts' field to BlockDriverblock/file-posix.c block/qcow2.c block/raw-format.c +1 more+42 -00 replies
10/13block: Add bdrv_reset_options_allowed()block.c+58 -00 replies
11/13block: Remove the AioContext parameter from bdrv_reopen_multiple()block.c block/replication.c include/block/block.h +1 more+5 -60 replies
12/13block: Add an 'x-blockdev-reopen' QMP commandblockdev.c qapi/block-core.json+89 -00 replies
13/13qemu-iotests: Test the x-blockdev-reopen QMP commandtests/qemu-iotests/243 tests/qemu-iotests/243.out tests/qemu-iotests/group+997 -06 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/13] Add a 'x-blockdev-reopen' QMP command

Hi,

here's a new version of the patches to add a new QMP command for bdrv_reopen().

Refer to the cover letter of v1 for a complete description of the feature:

https://lists.gnu.org/archive/html/qemu-block/2019-01/msg00623.html

Regards,

Berto

v2:
- Patch 1: Update documentation, fix check in bdrv_drop_intermediate() and add a new one in bdrv_replace_node() [Kevin]
- Patch 2: Add a missing unfreeze call if commit_start() fails, and prevent a double unfreeze in commit_abort() [Kevin]
- Patch 4: Prevent double unfreeze in stream_abort() [Kevin]
- Patch 6: Update documentation and don't complain for a missing 'backing' option if the driver does not support backing files [Kevin]
- Patch 7: Contextual differences due to changes in previous patches.
- Patch 8: Forbid changing the backing file if there are implicit nodes on the way. Simplify code and update the permission checks to handle a new backing file [Kevin, Berto]
- Patch 9: Remove BlockDriver.runtime_opts from the previous version and use only mutable_opts [Kevin]
- Patch 10: Compare bs->options with reopen_state->options to see what options the user is trying to reset [Kevin]
- Patch 13: Update the tests to reflect all the new changes.

v1: https://lists.gnu.org/archive/html/qemu-block/2019-01/msg00623.html
- Patch 10: forbid setting a new backing file with a different AioContext.
- Patch 13 (new): Remove unused parameter from bdrv_reopen_multiple.
- Patch 14: Acquire the AioContext before calling bdrv_reopen_multiple().
- Patch 15: More test cases.
- Patches 3, 8, 9, 11, 12: scripts/checkpatch.pl is more picky now with the format of multi-line comments, so correct them.

RFCv2: https://lists.gnu.org/archive/html/qemu-block/2018-11/msg00901.html

Output of backport-diff against v1:

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/13:[0021] [FC] 'block: Allow freezing BdrvChild links'
002/13:[0010] [FC] 'block: Freeze the backing chain for the duration of the commit job' 003/13:[----] [--] 'block: Freeze the backing chain for the duration of the mirror job' 004/13:[0009] [FC] 'block: Freeze the backing chain for the duration of the stream job' 005/13:[----] [--] 'block: Add 'keep_old_opts' parameter to bdrv_reopen_queue()' 006/13:[0009] [FC] 'block: Handle child references in bdrv_reopen_queue()' 007/13:[0004] [FC] 'block: Allow omitting the 'backing' option in certain cases' 008/13:[0118] [FC] 'block: Allow changing the backing file on reopen' 009/13:[down] 'block: Add a 'mutable_opts' field to BlockDriver' 010/13:[0070] [FC] 'block: Add bdrv_reset_options_allowed()' 011/13:[----] [--] 'block: Remove the AioContext parameter from bdrv_reopen_multiple()' 012/13:[----] [--] 'block: Add an 'x-blockdev-reopen' QMP command' 013/13:[0036] [FC] 'qemu-iotests: Test the x-blockdev-reopen QMP command'

Alberto Garcia (13):
block: Allow freezing BdrvChild links
block: Freeze the backing chain for the duration of the commit job
block: Freeze the backing chain for the duration of the mirror job
block: Freeze the backing chain for the duration of the stream job
block: Add 'keep_old_opts' parameter to bdrv_reopen_queue()
block: Handle child references in bdrv_reopen_queue()
block: Allow omitting the 'backing' option in certain cases
block: Allow changing the backing file on reopen
block: Add a 'mutable_opts' field to BlockDriver
block: Add bdrv_reset_options_allowed()
block: Remove the AioContext parameter from bdrv_reopen_multiple()
block: Add an 'x-blockdev-reopen' QMP command
qemu-iotests: Test the x-blockdev-reopen QMP command

 block.c                    | 390 ++++++++++++++++--
 block/commit.c             |  16 +
 block/file-posix.c         |   6 +
 block/mirror.c             |   8 +
 block/qcow2.c              |  25 ++
 block/raw-format.c         |   3 +
 block/replication.c        |   7 +-
 block/stream.c             |  21 +
 blockdev.c                 |  47 +++
 include/block/block.h      |  13 +-
 include/block/block_int.h  |  14 +
 qapi/block-core.json       |  42 ++
 qemu-io-cmds.c             |   4 +-
 tests/qemu-iotests/243     | 991 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/243.out |   5 +
 tests/qemu-iotests/group   |   1 +
 16 files changed, 1562 insertions(+), 31 deletions(-)
 create mode 100644 tests/qemu-iotests/243
 create mode 100644 tests/qemu-iotests/243.out
Signature · 1 line
2.11.0