Skip to content

Move and clean up monitor command code

Markus Armbruster kvm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest32 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32monitor: Drop unnecessary includesmonitor/hmp-cmds.c monitor/hmp.c monitor/misc.c +3 more+2 -291 reply
2/32audio: Move HMP commands from monitor/ to audio/audio/audio-hmp-cmds.c audio/meson.build include/monitor/hmp.h +1 more+87 -560 replies
3/32char: Move HMP commands from monitor/ to chardev/chardev/char-hmp-cmds.c chardev/meson.build monitor/hmp-cmds.c +1 more+225 -2020 replies
4/32char: Factor out qmp_add_client() parts and move to chardev/chardev/char.c include/monitor/qmp-helpers.h monitor/qmp-cmds.c+25 -110 replies
5/32hmp: Drop redundant argument check from add_completion_option()monitor/misc.c+0 -30 replies
6/32readline: Extract readline_add_completion_of() from monitorinclude/qemu/readline.h monitor/hmp.c monitor/misc.c +1 more+41 -660 replies
7/32hmp: Rename help_cmd() to hmp_help_cmd(), move declaration to hmp.hinclude/monitor/hmp.h monitor/hmp.c monitor/misc.c +1 more+6 -60 replies
8/32trace: Move HMP commands from monitor/ to trace/include/monitor/hmp.h monitor/misc.c trace/meson.build +1 more+152 -1192 replies
9/32machine: Move QMP commands from monitor/ to hw/core/hw/core/machine-qmp-cmds.c monitor/qmp-cmds.c+144 -1400 replies
10/32machine: Move HMP commands from monitor/ to hw/core/hw/core/machine-hmp-cmds.c monitor/hmp-cmds.c+208 -2090 replies
11/32qom: Move HMP commands from monitor/ to qom/monitor/hmp-cmds.c monitor/misc.c qom/qom-hmp-cmds.c+67 -681 reply
12/32block: Factor out hmp_change_medium(), and move to block/monitor/block/monitor/block-hmp-cmds.c include/monitor/hmp.h monitor/hmp-cmds.c+25 -162 replies
13/32rocker: Move HMP commands from monitor to hw/net/rocker/hw/net/meson.build hw/net/rocker/rocker-hmp-cmds.c monitor/hmp-cmds.c+317 -2970 replies
14/32hmp: Rewrite strlist_from_comma_list() as hmp_split_at_comma()include/monitor/hmp.h monitor/hmp-cmds.c+11 -170 replies
15/32net: Move HMP commands from monitor to net/monitor/hmp-cmds.c monitor/misc.c net/meson.build +1 more+143 -1170 replies
16/32net: Move hmp_info_network() to net-hmp-cmds.cinclude/monitor/hmp.h include/net/net.h monitor/hmp-cmds.c +3 more+33 -300 replies
17/32migration: Move HMP commands from monitor/ to migration/migration/meson.build migration/migration-hmp-cmds.c monitor/hmp-cmds.c +1 more+808 -7851 reply
18/32migration: Move the QMP command from monitor/ to migration/migration/migration.c monitor/misc.c+30 -311 reply
19/32virtio: Move HMP commands from monitor/ to hw/virtio/hw/virtio/meson.build hw/virtio/virtio-hmp-cmds.c monitor/hmp-cmds.c+322 -3091 reply
20/32tpm: Move HMP commands from monitor/ to softmmu/MAINTAINERS monitor/hmp-cmds.c softmmu/meson.build +1 more+67 -551 reply
21/32runstate: Move HMP commands from monitor/ to softmmu/MAINTAINERS include/monitor/hmp.h monitor/hmp-cmds.c +3 more+86 -640 replies
22/32stats: Move QMP commands from monitor/ to stats/MAINTAINERS accel/kvm/kvm-all.c include/sysemu/stats.h +4 more+170 -1530 replies
23/32stats: Move HMP commands from monitor/ to stats/monitor/hmp-cmds.c stats/meson.build stats/stats-hmp-cmds.c+248 -2350 replies
24/32acpi: Move the QMP command from monitor/ to hw/acpi/hw/acpi/acpi-qmp-cmds.c hw/acpi/meson.build monitor/qmp-cmds.c+31 -211 reply
25/32qdev: Move HMP command completion from monitor to softmmu/monitor/misc.c softmmu/qdev-monitor.c+82 -820 replies
26/32monitor: Split file descriptor passing stuff off misc.cmonitor/fds.c monitor/meson.build monitor/misc.c+469 -4340 replies
27/32monitor: Move monitor_putc() next to monitor_puts & external linkageinclude/monitor/monitor.h monitor/misc.c monitor/monitor.c+28 -270 replies
28/32monitor: Move target-dependent HMP commands to hmp-cmds-target.cinclude/monitor/hmp-target.h monitor/hmp-cmds-target.c monitor/meson.build +1 more+388 -3510 replies
29/32monitor: Move remaining HMP commands from misc.c to hmp-cmds.chmp-commands.hx include/monitor/hmp.h monitor/hmp-cmds.c +1 more+233 -2210 replies
30/32monitor: Move remaining QMP stuff from misc.c to qmp-cmds.cmonitor/misc.c monitor/qmp-cmds.c+52 -520 replies
31/32monitor: Loosen coupling between misc.c and monitor.c slightlymonitor/misc.c monitor/monitor.c storage-daemon/qemu-storage-daemon.c+4 -100 replies
32/32monitor: Rename misc.c to hmp-target.cmonitor/hmp-target.c monitor/meson.build+2 -20 replies

Reviews trailers per patch

9 of 32 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéStefan HajnocziStefan BergerJuan Quintela
1/32R-b
2/32
3/32
4/32
5/32
6/32
7/32
8/32R-b R-b
9/32
10/32
11/32R-b
12/32R-b R-b
13/32
14/32
15/32
16/32
17/32R-b
18/32R-b
19/32R-b
20/32R-b
21/32
22/32
23/32
24/32R-b
25/32
26/32
27/32
28/32
29/32
30/32
31/32
32/32

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

Read the v1 thread

Cover letter [PATCH 00/32] Move and clean up monitor command code

Over the years, many commands got dumped into monitor/, where MAINTAINERS blames them on Dave and me. Recent "[PATCH v2 00/13] pci:
Move and clean up monitor command code" (merge commit 33698d3abf8) evicted commands related to PCI (qapi/pci.json), and "[PATCH v4 00/17]
ui: Move and clean up monitor command code" (merge commit 70d17c3eede) evicted commands rated to UI (qapi/ui.json) This series evicts most of the rest. Commands related to the monitor itself (qapi/control.json qapi/introspect.json) and miscellaneous commands (qapi/misc.json) stay in monitor/.

Together, these patches move almost 4000 lines from monitor/ to subsystems where they belong.

Based-on: <[email protected]>

Markus Armbruster (32):
monitor: Drop unnecessary includes
audio: Move HMP commands from monitor/ to audio/
char: Move HMP commands from monitor/ to chardev/
char: Factor out qmp_add_client() parts and move to chardev/
hmp: Drop redundant argument check from add_completion_option()
readline: Extract readline_add_completion_of() from monitor
hmp: Rename help_cmd() to hmp_help_cmd(), move declaration to hmp.h
trace: Move HMP commands from monitor/ to trace/
machine: Move QMP commands from monitor/ to hw/core/
machine: Move HMP commands from monitor/ to hw/core/
qom: Move HMP commands from monitor/ to qom/
block: Factor out hmp_change_medium(), and move to block/monitor/
rocker: Move HMP commands from monitor to hw/net/rocker/
hmp: Rewrite strlist_from_comma_list() as hmp_split_at_comma()
net: Move HMP commands from monitor to net/
net: Move hmp_info_network() to net-hmp-cmds.c
migration: Move HMP commands from monitor/ to migration/
migration: Move the QMP command from monitor/ to migration/
virtio: Move HMP commands from monitor/ to hw/virtio/
tpm: Move HMP commands from monitor/ to softmmu/
runstate: Move HMP commands from monitor/ to softmmu/
stats: Move QMP commands from monitor/ to stats/
stats: Move HMP commands from monitor/ to stats/
acpi: Move the QMP command from monitor/ to hw/acpi/
qdev: Move HMP command completion from monitor to softmmu/
monitor: Split file descriptor passing stuff off misc.c
monitor: Move monitor_putc() next to monitor_puts & external linkage
monitor: Move target-dependent HMP commands to hmp-cmds-target.c
monitor: Move remaining HMP commands from misc.c to hmp-cmds.c
monitor: Move remaining QMP stuff from misc.c to qmp-cmds.c
monitor: Loosen coupling between misc.c and monitor.c slightly
monitor: Rename misc.c to hmp-target.c

 MAINTAINERS                          |   10 +-
 meson.build                          |    1 +
 include/monitor/hmp-target.h         |    6 +
 include/monitor/hmp.h                |   27 +
 include/monitor/monitor.h            |    1 +
 include/monitor/qmp-helpers.h        |    3 +
 include/net/net.h                    |    4 +-
 include/qemu/readline.h              |    2 +
 include/{monitor => sysemu}/stats.h  |    0
 monitor/monitor-internal.h           |    1 -
 accel/kvm/kvm-all.c                  |    2 +-
 audio/audio-hmp-cmds.c               |   83 +
 block/monitor/block-hmp-cmds.c       |   21 +
 chardev/char-hmp-cmds.c              |  220 +++
 chardev/char.c                       |   20 +
 hw/acpi/acpi-qmp-cmds.c              |   30 +
 hw/core/machine-hmp-cmds.c           |  208 +++
 hw/core/machine-qmp-cmds.c           |  144 ++
 hw/net/rocker/rocker-hmp-cmds.c      |  316 ++++
 hw/virtio/virtio-hmp-cmds.c          |  321 ++++
 migration/migration-hmp-cmds.c       |  807 ++++++++++
 migration/migration.c                |   30 +
 monitor/fds.c                        |  468 ++++++
 monitor/hmp-cmds-target.c            |  380 +++++
 monitor/hmp-cmds.c                   | 2181 ++------------------------
 monitor/hmp-target.c                 |  178 +++
 monitor/hmp.c                        |   17 +-
 monitor/misc.c                       | 1906 ----------------------
 monitor/monitor.c                    |   30 +-
 monitor/qmp-cmds-control.c           |    1 -
 monitor/qmp-cmds.c                   |  355 +----
 net/net-hmp-cmds.c                   |  170 ++
 net/net.c                            |   28 +-
 qom/qom-hmp-cmds.c                   |   67 +
 softmmu/qdev-monitor.c               |   82 +
 softmmu/runstate-hmp-cmds.c          |   82 +
 softmmu/tpm-hmp-cmds.c               |   65 +
 stats/stats-hmp-cmds.c               |  247 +++
 stats/stats-qmp-cmds.c               |  162 ++
 storage-daemon/qemu-storage-daemon.c |    4 +-
 trace/trace-hmp-cmds.c               |  148 ++
 util/readline.c                      |    8 +
 audio/meson.build                    |    1 +
 chardev/meson.build                  |    6 +-
 hmp-commands.hx                      |    4 +-
 hw/acpi/meson.build                  |    1 +
 hw/net/meson.build                   |    1 +
 hw/virtio/meson.build                |    1 +
 migration/meson.build                |    1 +
 monitor/meson.build                  |    4 +-
 net/meson.build                      |    1 +
 softmmu/meson.build                  |    2 +
 stats/meson.build                    |    1 +
 trace/meson.build                    |    1 +
 54 files changed, 4574 insertions(+), 4286 deletions(-)
 rename include/{monitor => sysemu}/stats.h (100%)
 create mode 100644 audio/audio-hmp-cmds.c
 create mode 100644 chardev/char-hmp-cmds.c
 create mode 100644 hw/acpi/acpi-qmp-cmds.c
 create mode 100644 hw/net/rocker/rocker-hmp-cmds.c
 create mode 100644 hw/virtio/virtio-hmp-cmds.c
 create mode 100644 migration/migration-hmp-cmds.c
 create mode 100644 monitor/fds.c
 create mode 100644 monitor/hmp-cmds-target.c
 create mode 100644 monitor/hmp-target.c
 delete mode 100644 monitor/misc.c
 create mode 100644 net/net-hmp-cmds.c
 create mode 100644 softmmu/runstate-hmp-cmds.c
 create mode 100644 softmmu/tpm-hmp-cmds.c
 create mode 100644 stats/stats-hmp-cmds.c
 create mode 100644 stats/stats-qmp-cmds.c
 create mode 100644 trace/trace-hmp-cmds.c
 create mode 100644 stats/meson.build
Signature · 1 line
2.39.0