Skip to content

chardev: Add -qmp-pretty

Max Reitz qemu-devel 4 versions – Applied

Status from this message: Thanks, applied to block-next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 11 repliesApplied
  2. v33 patches 0 repliesSuperseded
  3. v23 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches7 repliesSuperseded

Changes in v4 from the cover letter

- Patch 2: Add newline in sed script after c\ [Eric]

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3chardev: Add -qmp-prettyqemu-options.hx vl.c+18 -50 replies
2/3iotests: _filter_qmp for pretty JSON outputtests/qemu-iotests/common.filter+3 -13 replies
3/3iotests: Use -qmp-pretty in 067tests/qemu-iotests/067 tests/qemu-iotests/067.out+723 -583 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/3R-b
2/3R-b
3/3R-b

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

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty

This series does not add new functionality. Adding a QMP monitor with prettily formatted JSON output can be done as follows:

$ qemu -chardev stdio,id=mon0 -mon chardev=mon0,mode=control,pretty=on

However, this is rather cumbersome, so this series (its first patch) adds a shortcut in the form of the new command line option -qmp-pretty.

Since the argument given to a monitor command line option (such as -qmp) is parsed depending on its prefix and probably also depending on the current phase of the moon, this is cleaner than trying to add a "switch" to -qmp itself (in the form of "-qmp stdio,pretty=on").

Patch 3 makes uses of the new option in qemu-iotest 067 to greatly increase maintainability of its reference output. Patch 2 extends the QMP filter for qemu-iotests so it is able to filter out the QMP version object in pretty mode.

v4:
- Patch 2: Add newline in sed script after c\ [Eric]

v3:
- Patch 2: Cull useless "discard=0"

v2:
- Patch 2: Replaced the multi-line QMP_VERSION replacement written in bash by a nice sed script [Eric]

git-backport-diff against v3:

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/3:[----] [--] 'chardev: Add -qmp-pretty' 002/3:[0003] [FC] 'iotests: _filter_qmp for pretty JSON output' 003/3:[----] [--] 'iotests: Use -qmp-pretty in 067'

Max Reitz (3):
chardev: Add -qmp-pretty
iotests: _filter_qmp for pretty JSON output
iotests: Use -qmp-pretty in 067

 qemu-options.hx                  |   8 +
 tests/qemu-iotests/067           |   2 +-
 tests/qemu-iotests/067.out       | 779 ++++++++++++++++++++++++++++++++++++---
 tests/qemu-iotests/common.filter |   4 +-
 vl.c                             |  15 +-
 5 files changed, 744 insertions(+), 64 deletions(-)
Signature · 1 line
1.9.3