Skip to content

blkdebug/blkverify: Allow QMP configuration

Max Reitz qemu-devel 7 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest24 patches 4 repliesApplied
  2. v622 patches 12 repliesSuperseded
  3. v522 patches 37 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v3 posting 2/20 of 21 patches1 replySuperseded
v3 posting 1/221 patches9 repliesSuperseded
v27 patches4 repliesSuperseded
v16 patches2 repliesSuperseded

Changes in v7 from the cover letter

- Addressed Eric's and Stefan's comments (first number is patch number in v6, second is patch number in this series):
- Patch 3/3: Adjusted comment
- Patch 4/4: Hopefully finally fixed
- Patch 5/5: Rebased on Peter's series (don't use qemu_opts_create_nofail); note that this does not add a dependency on that series
- Patch 8/8: Rebased on Fam's series (or rather, Stefan's block branch); the changes in VMDK introduced new calls to bdrv_file_open(), which have to be adjusted as is done in the remainder of the patch
- Patch 21/-: Added
- Patch 22/-: Added

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/24blkdebug: Use errp for read_config()block/blkdebug.c+6 -40 replies
2/24blkdebug: Don't require sophisticated filenameblock/blkdebug.c+3 -10 replies
3/24qdict: Add qdict_array_split()include/qapi/qmp/qdict.h qobject/qdict.c+38 -00 replies
4/24qapi: extend qdict_flatten() for QListsqobject/qdict.c+48 -61 reply
5/24qemu-option: Add qemu_config_parse_qdict()include/qemu/config-file.h util/qemu-config.c+106 -00 replies
6/24blkdebug: Always call read_config()block/blkdebug.c+19 -170 replies
7/24blkdebug: Use command-line in read_config()block/blkdebug.c+12 -30 replies
8/24block: Allow reference for bdrv_file_open()block.c block/blkdebug.c block/blkverify.c +9 more+41 -190 replies
9/24block: Pass reference to bdrv_file_open()block.c+4 -10 replies
10/24block: Allow block devices without filesblock.c+16 -70 replies
11/24block: Add bdrv_open_image()block.c include/block/block.h+76 -00 replies
12/24block: Use bdrv_open_image() in bdrv_open()block.c+5 -130 replies
13/24block: Allow recursive "file"sblock.c tests/qemu-iotests/051.out+8 -30 replies
14/24blockdev: Move "file" to legacy_optsblockdev.c+10 -90 replies
15/24blkdebug: Allow command-line file configurationblock/blkdebug.c+3 -90 replies
16/24blkverify: Allow command-line configurationblock/blkverify.c+5 -200 replies
17/24blkverify: Don't require protocol filenameblock/blkverify.c+3 -10 replies
18/24qapi: Add "errno" to the list of polluted wordsscripts/qapi.py+1 -10 replies
19/24qapi: QMP interface for blkdebug and blkverifyqapi-schema.json+109 -40 replies
20/24qemu-io: Make filename optionalqemu-io.c+5 -30 replies
21/24tests: Add test for qdict_array_split()tests/check-qdict.c+80 -01 reply
22/24tests: Add test for qdict_flatten()tests/check-qdict.c+76 -01 reply
23/24iotests: Test new blkdebug/blkverify interfacetests/qemu-iotests/071 tests/qemu-iotests/071.out tests/qemu-iotests/group+330 -00 replies
24/24iotests: Test file format nestingtests/qemu-iotests/072 tests/qemu-iotests/072.out tests/qemu-iotests/group+91 -00 replies

Reviews trailers per patch

12 of 24 patches have a Reviewed-by or Acked-by.

PatchKevin WolfEric Blake
1/24R-b R-b
2/24R-b R-b
3/24R-b R-b
4/24R-b
5/24
6/24R-b R-b
7/24R-b
8/24R-b
9/24R-b
10/24
11/24
12/24
13/24
14/24R-b
15/24
16/24
17/24
18/24
19/24
20/24R-b
21/24R-b
22/24R-b
23/24
24/24

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [Qemu-devel] [PATCH v7 00/24] blkdebug/blkverify: Allow QMP configuration

Currently, the configuration of blkdebug and blkverify is done through the "filename" alone. There is now way of manually choosing blkdebug or blkverify as a driver and using a normal image filename.

In the case of blkdebug, the filename starts with the protocol prefix, follows up with the name of a configuration file and ends with the name of the image file.

In the case of blkverify, the filename starts with the protocol prefix, follows up with the raw reference image filename and ends with the name of the image file.

This patch allows the configuration of both drivers completely through QMP and accordingly command-line options. The driver has to be selected through the driver option (or similar), the image filename may be given either as the filename itself or through a x.filename option, where "x" depends on the driver. Further options may be required depending on the driver.

In case of blkverify, the test image may be specified either through the filename or as a BlockdevRef reference through the "test" option. The raw image is referenced as "raw".

In case of blkdebug, one may either set the "config" option to the filename of a configuration file, or the content of the configuration file may be given directly (as options). The image filename is either specified as the filename or referenced through the "image" option.

v7:
- Addressed Eric's and Stefan's comments (first number is patch number in v6, second is patch number in this series):
- Patch 3/3: Adjusted comment
- Patch 4/4: Hopefully finally fixed
- Patch 5/5: Rebased on Peter's series (don't use qemu_opts_create_nofail); note that this does not add a dependency on that series
- Patch 8/8: Rebased on Fam's series (or rather, Stefan's block branch); the changes in VMDK introduced new calls to bdrv_file_open(), which have to be adjusted as is done in the remainder of the patch
- Patch 21/-: Added
- Patch 22/-: Added

v6:
- Addressed Kevin's and Eric's comments (first number is patch number in v5, second is patch number in this series):
- Patch 4/4: Adjusted comment
- Patch 5/-: Dropped
- Patch 11/10: Guard against !drv && !file before find_image_format()
- Patch -/11: Added
- Patch -/12: Added
- Patch 12/13: Removed unnecessary hunk and squashed next patch into this one
- Patch 13/-: Squashed into previous patch
- Patch 15/15: Dropped static open_image() in favor of the global bdrv_open_image()
- Patch 16/-: Dropped
- Patch 17/16: Dropped static open_image() in favor of the global bdrv_open_image(); also, disable format auto-detection for the raw image
- Patch 18/17: Drop check for !filename since the filename is always passed to this function
- Patch 19/18: Add "errno" to the list of polluted words in qapi.py rather than introduce a new alias
- Patch 20/19: Use enumeration for the blkdebug trigger events; also, we can and must use "errno" now instead of "error"
- Patch 22/21: Fix test by increasing the image size; add actually working tests for blkverify failures; add test for blkverify using an already existing block device as the raw image
- Patch -/22: Added

v5:
- Addressed Fam's comments:
- Patch 4: Asserted against prefix == NULL in qdict_flatten_qlist()
- Patch 4: Support other types than QDicts and QLists in QLists in qdict_flatten_qlist()
- Patch 4: Modified comment above qdict_flatten() to include the functionality of qdict_flatten_qlist()
- Patch 8 (now patch 9): Removed goto fail; in favor of directly returning in the if (reference) patch - this fixes a double QDECREF(options) as well as two bs dereferences with bs being NULL
- Patch 21 (now patch 22): Added reason for not using Python to the commit message
- Added patch 5: Cleans up qdict_flatten_qdict() which contains a now unused delete variable

v4:
- Fixed a memleak in qdict_flatten_qlist() in patch 4

v3:
- The first few patches are probably similar to the ones from the previous series; but it's probably best to see this series as a completely new one.

git-backport-diff against v6:

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/24:[----] [--] 'blkdebug: Use errp for read_config()' 002/24:[----] [--] 'blkdebug: Don't require sophisticated filename' 003/24:[0013] [FC] 'qdict: Add qdict_array_split()' 004/24:[0003] [FC] 'qapi: extend qdict_flatten() for QLists' 005/24:[0007] [FC] 'qemu-option: Add qemu_config_parse_qdict()' 006/24:[----] [--] 'blkdebug: Always call read_config()' 007/24:[----] [--] 'blkdebug: Use command-line in read_config()' 008/24:[0004] [FC] 'block: Allow reference for bdrv_file_open()' 009/24:[----] [--] 'block: Pass reference to bdrv_file_open()' 010/24:[----] [--] 'block: Allow block devices without files' 011/24:[----] [--] 'block: Add bdrv_open_image()' 012/24:[----] [--] 'block: Use bdrv_open_image() in bdrv_open()' 013/24:[----] [--] 'block: Allow recursive "file"s' 014/24:[----] [--] 'blockdev: Move "file" to legacy_opts' 015/24:[----] [-C] 'blkdebug: Allow command-line file configuration' 016/24:[----] [-C] 'blkverify: Allow command-line configuration' 017/24:[----] [--] 'blkverify: Don't require protocol filename' 018/24:[----] [--] 'qapi: Add "errno" to the list of polluted words' 019/24:[----] [--] 'qapi: QMP interface for blkdebug and blkverify' 020/24:[----] [--] 'qemu-io: Make filename optional' 021/24:[down] 'tests: Add test for qdict_array_split()' 022/24:[down] 'tests: Add test for qdict_flatten()' 023/24:[----] [--] 'iotests: Test new blkdebug/blkverify interface' 024/24:[----] [--] 'iotests: Test file format nesting'

Max Reitz (24):
blkdebug: Use errp for read_config()
blkdebug: Don't require sophisticated filename
qdict: Add qdict_array_split()
qapi: extend qdict_flatten() for QLists
qemu-option: Add qemu_config_parse_qdict()
blkdebug: Always call read_config()
blkdebug: Use command-line in read_config()
block: Allow reference for bdrv_file_open()
block: Pass reference to bdrv_file_open()
block: Allow block devices without files
block: Add bdrv_open_image()
block: Use bdrv_open_image() in bdrv_open()
block: Allow recursive "file"s
blockdev: Move "file" to legacy_opts
blkdebug: Allow command-line file configuration
blkverify: Allow command-line configuration
blkverify: Don't require protocol filename
qapi: Add "errno" to the list of polluted words
qapi: QMP interface for blkdebug and blkverify
qemu-io: Make filename optional
tests: Add test for qdict_array_split()
tests: Add test for qdict_flatten()
iotests: Test new blkdebug/blkverify interface
iotests: Test file format nesting

 block.c                    | 123 ++++++++++++++++++++---
 block/blkdebug.c           |  59 ++++++-----
 block/blkverify.c          |  29 ++----
 block/cow.c                |   3 +-
 block/qcow.c               |   3 +-
 block/qcow2.c              |   2 +-
 block/qed.c                |   4 +-
 block/sheepdog.c           |   4 +-
 block/vhdx.c               |   2 +-
 block/vmdk.c               |   8 +-
 blockdev.c                 |  19 ++--
 include/block/block.h      |   6 +-
 include/qapi/qmp/qdict.h   |   1 +
 include/qemu/config-file.h |   6 ++
 qapi-schema.json           | 113 ++++++++++++++++++++-
 qemu-io.c                  |  10 +-
 qobject/qdict.c            |  91 +++++++++++++++--
 scripts/qapi.py            |   2 +-
 tests/check-qdict.c        | 156 +++++++++++++++++++++++++++++
 tests/qemu-iotests/051.out |   2 +-
 tests/qemu-iotests/071     | 239 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/071.out |  90 +++++++++++++++++
 tests/qemu-iotests/072     |  69 +++++++++++++
 tests/qemu-iotests/072.out |  21 ++++
 tests/qemu-iotests/group   |   2 +
 util/qemu-config.c         | 100 +++++++++++++++++++
 26 files changed, 1069 insertions(+), 95 deletions(-)
 create mode 100755 tests/qemu-iotests/071
 create mode 100644 tests/qemu-iotests/071.out
 create mode 100755 tests/qemu-iotests/072
 create mode 100644 tests/qemu-iotests/072.out
Signature · 1 line
1.8.5.1