[GIT PULL 00/50] Make HMP optional

Marc-André Lureau posted 50 patches 4 weeks, 1 day ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@mailo.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, zhenwei pi <zhenwei.pi@linux.dev>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Markus Armbruster <armbru@redhat.com>, Ani Sinha <anisinha@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, "Michael S. Tsirkin" <mst@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Amit Shah <amit@kernel.org>, Brian Cain <brian.cain@oss.qualcomm.com>, David Woodhouse <dwmw2@infradead.org>, Paul Durrant <paul@xen.org>, Marcelo Tosatti <mtosatti@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Jason Wang <jasowangio@gmail.com>, Jiri Pirko <jiri@resnulli.us>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Jason Herne <jjherne@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Peter Xu <peterx@redhat.com>, Hyman Huang <infra.ai.cloud@bitdeer.com>, Fabiano Rosas <farosas@suse.de>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Eric Blake <eblake@redhat.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Zhao Liu <zhao1.liu@intel.com>, Chinmay Rath <rathc@linux.ibm.com>, Nicholas Piggin <npiggin@gmail.com>, Glenn Miles <milesg@linux.ibm.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu@processmission.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>, Thomas Huth <th.huth+qemu@posteo.eu>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, "Denis V. Lunev" <den@openvz.org>, Aditya Gupta <adityag@linux.ibm.com>, Gautam Menghani <gautam@linux.ibm.com>, Stefan Hajnoczi <stefanha@redhat.com>
There is a newer version of this series
.gitlab-ci.d/buildtest.yml                         |   1 +
accel/accel-system.c                               |   3 +
accel/tcg/monitor.c                                |   3 +
audio/audio-hmp-cmds.c                             |  10 +-
audio/meson.build                                  |   4 +-
backends/cryptodev-hmp-cmds.c                      |  10 +-
backends/meson.build                               |   5 +-
block/monitor/block-hmp-cmds.c                     | 341 +++++++----------
block/monitor/meson.build                          |   5 +-
block/monitor/qmp-cmds.c                           |  79 ++++
chardev/char-hmp-cmds.c                            |  36 +-
chardev/char.c                                     |  11 +-
chardev/meson.build                                |   5 +-
disas/disas-mon.c                                  |  11 +-
disas/meson.build                                  |   4 +-
docs/devel/style.rst                               |   2 +-
docs/devel/writing-monitor-commands.rst            |   8 +-
dump/dump-hmp-cmds.c                               |  12 +-
dump/meson.build                                   |   5 +-
gdbstub/system.c                                   |  10 +-
hmp-commands-info.hx                               |   6 +-
hmp-commands.hx                                    |   9 +-
hw/char/virtio-serial-bus.c                        |  21 +-
hw/core/machine-hmp-cmds.c                         | 263 +++++++------
hw/core/meson.build                                |   5 +-
hw/core/sysbus.c                                   |  15 +-
hw/hexagon/hexagon_tlb.c                           |  87 ++---
hw/i386/kvm/xen-stubs.c                            |  10 +-
hw/i386/kvm/xen_evtchn.c                           |  28 +-
hw/i386/meson.build                                |   4 +-
hw/i386/sgx-hmp-stub.c                             |   4 +-
hw/i386/sgx.c                                      |  32 +-
hw/misc/auxbus.c                                   |  29 +-
hw/misc/mos6522-stub.c                             |   6 +-
hw/misc/mos6522.c                                  |   7 +-
hw/net/meson.build                                 |   4 +-
hw/net/rocker/rocker-hmp-cmds.c                    | 158 ++++----
hw/pci/meson.build                                 |   4 +-
hw/pci/pci-hmp-cmds.c                              | 121 +++---
hw/pci/pci-internal.h                              |   2 +-
hw/pci/pci-stub.c                                  |   8 +-
hw/pci/pci.c                                       |   2 +
hw/s390x/s390-skeys.c                              |  14 +-
hw/s390x/s390-stattrib.c                           |  26 +-
hw/uefi/ovmf-log.c                                 |  10 +-
hw/usb/bus.c                                       |  21 +-
hw/usb/host-libusb.c                               |  29 +-
hw/virtio/meson.build                              |   4 +-
hw/virtio/virtio-hmp-cmds.c                        | 312 ++++++++--------
hw/xen/xen-bus.c                                   |  11 +-
include/block/block-hmp-cmds.h                     |  55 +--
include/disas/disas.h                              |   4 +-
include/hw/core/qdev.h                             |   5 +-
include/hw/core/sysemu-cpu-ops.h                   |   2 +
include/hw/hexagon/hexagon_tlb.h                   |   5 +-
include/hw/usb/usb.h                               |   3 +-
include/monitor/hmp.h                              | 334 +++++++++--------
include/monitor/monitor.h                          |  21 --
include/monitor/qdev.h                             |   5 +-
include/net/net.h                                  |   8 +-
include/net/slirp.h                                |   8 +-
include/qemu-io.h                                  |   4 +-
include/system/memory.h                            |   2 +
meson.build                                        |   6 +-
meson_options.txt                                  |   2 +
migration/dirtyrate.c                              |  52 +--
migration/meson.build                              |   4 +-
migration/migration-hmp-cmds.c                     | 363 +++++++++---------
monitor/hmp-cmds.c                                 | 290 +++++++--------
monitor/hmp.c                                      | 257 +++++++------
monitor/meson.build                                |   9 +-
monitor/monitor-hmp-internal.h                     | 106 ++++++
monitor/monitor-internal.h                         | 104 ------
monitor/monitor.c                                  |  76 ++--
monitor/qmp-cmds.c                                 |   5 +-
net/hub.c                                          |  29 +-
net/hub.h                                          |   4 +-
net/meson.build                                    |   4 +-
net/net-hmp-cmds.c                                 |  85 +++--
net/net.c                                          |  70 +++-
net/slirp.c                                        |  70 ++--
python/qemu/utils/__init__.py                      |   5 +-
qapi/block.json                                    |  34 ++
qapi/control.json                                  |   4 +-
qapi/misc.json                                     |   3 +-
qapi/net.json                                      | 166 +++++++++
qemu-io-cmds.c                                     | 414 +++++++++++----------
qemu-io.c                                          |  17 +-
qemu-options.hx                                    |   6 +-
qom/meson.build                                    |   4 +-
qom/qom-hmp-cmds.c                                 |  46 +--
replay/replay-debugging.c                          |  20 +-
replay/stubs-system.c                              |  14 +-
scripts/meson-buildoptions.sh                      |   3 +
stats/meson.build                                  |   5 +-
stats/stats-hmp-cmds.c                             |  60 +--
stubs/hmp-cmd-info_sev.c                           |   4 +-
stubs/meson.build                                  |  15 +-
stubs/monitor-core.c                               |  21 +-
stubs/monitor-cur.c                                |  14 +
stubs/monitor-hmp.c                                |   9 +
stubs/monitor-internal.c                           |   4 +-
stubs/qapi-event-emit.c                            |   8 +
system/dirtylimit-hmp-cmds.c                       |  20 +-
system/meson.build                                 |  11 +-
system/physmem.c                                   |  31 ++
system/qdev-monitor.c                              |  39 +-
system/qtest.c                                     |  14 +
system/runstate-hmp-cmds.c                         |  22 +-
system/tpm-hmp-cmds.c                              |  30 +-
system/vl.c                                        |   4 +-
target/hexagon/hex_mmu.c                           |   6 +-
target/hexagon/hex_mmu.h                           |   3 +-
target/i386/cpu-apic.c                             |   8 +-
target/i386/cpu.c                                  |   8 +-
target/i386/cpu.h                                  |   4 +-
target/i386/helper.c                               |  49 +--
target/i386/kvm/kvm.c                              |   4 +-
target/i386/monitor.c                              | 173 ++++-----
target/i386/sev.c                                  |  38 +-
target/m68k/cpu.c                                  |   4 +
target/m68k/monitor.c                              |   8 +-
target/ppc/monitor.c                               |   8 +-
target/riscv/monitor.c                             |  61 +--
target/rx/disas.c                                  |   1 +
target/sh4/monitor.c                               |  34 +-
target/sparc/cpu.c                                 |   5 +-
target/sparc/monitor.c                             |   8 +-
target/xtensa/monitor.c                            |   8 +-
tests/functional/generic/test_version.py           |  10 +-
tests/functional/qemu_test/utils.py                |   8 +-
tests/qemu-iotests/004.out                         |  20 +-
tests/qemu-iotests/021.out                         |  60 +--
tests/qemu-iotests/026.out                         | 228 ++++++------
tests/qemu-iotests/028                             |   1 +
tests/qemu-iotests/045                             |   3 +-
tests/qemu-iotests/051                             |   1 +
tests/qemu-iotests/056                             |   3 +-
tests/qemu-iotests/060                             |   1 +
tests/qemu-iotests/060.out                         |  44 ++-
tests/qemu-iotests/068                             |   1 +
tests/qemu-iotests/071                             |   1 +
tests/qemu-iotests/071.out                         |  10 +-
tests/qemu-iotests/072.out                         |   2 +-
tests/qemu-iotests/080.out                         |   4 +-
tests/qemu-iotests/081                             |   1 +
tests/qemu-iotests/081.out                         |   2 +-
tests/qemu-iotests/083.out                         |  36 +-
tests/qemu-iotests/089.out                         |   4 +-
tests/qemu-iotests/091                             |   1 +
tests/qemu-iotests/093                             |   3 +-
tests/qemu-iotests/102                             |   1 +
tests/qemu-iotests/114.out                         |   2 +-
tests/qemu-iotests/117                             |   1 +
tests/qemu-iotests/119                             |   1 +
tests/qemu-iotests/120                             |   1 +
tests/qemu-iotests/124                             |   3 +-
tests/qemu-iotests/130                             |   1 +
tests/qemu-iotests/132                             |   3 +-
tests/qemu-iotests/134.out                         |   2 +-
tests/qemu-iotests/136                             |   3 +-
tests/qemu-iotests/137.out                         |   2 +-
tests/qemu-iotests/142                             |   1 +
tests/qemu-iotests/145                             |   1 +
tests/qemu-iotests/146                             |   1 +
tests/qemu-iotests/148                             |   3 +-
tests/qemu-iotests/151                             |   3 +-
tests/qemu-iotests/152                             |   3 +-
tests/qemu-iotests/153                             |   1 +
tests/qemu-iotests/153.out                         |  12 +-
tests/qemu-iotests/156                             |   1 +
tests/qemu-iotests/157                             |   1 +
tests/qemu-iotests/161                             |   1 +
tests/qemu-iotests/165                             |   3 +-
tests/qemu-iotests/171                             |   2 +-
tests/qemu-iotests/171.out                         |  68 ++--
tests/qemu-iotests/172                             |   1 +
tests/qemu-iotests/181                             |   1 +
tests/qemu-iotests/185                             |   1 +
tests/qemu-iotests/186                             |   1 +
tests/qemu-iotests/192                             |   1 +
tests/qemu-iotests/201                             |   1 +
tests/qemu-iotests/205                             |   6 +-
tests/qemu-iotests/214.out                         |   2 +-
tests/qemu-iotests/216                             |   3 +-
tests/qemu-iotests/220.out                         |   2 +-
tests/qemu-iotests/225                             |   1 +
tests/qemu-iotests/225.out                         |   4 +-
tests/qemu-iotests/232                             |   1 +
tests/qemu-iotests/236                             |   3 +-
tests/qemu-iotests/244.out                         |  12 +-
tests/qemu-iotests/245                             |   3 +-
tests/qemu-iotests/246                             |   3 +-
tests/qemu-iotests/249                             |   1 +
tests/qemu-iotests/249.out                         |   6 +-
tests/qemu-iotests/254                             |   3 +-
tests/qemu-iotests/255                             |   3 +-
tests/qemu-iotests/257                             |   3 +-
tests/qemu-iotests/260                             |   3 +-
tests/qemu-iotests/264                             |   3 +-
tests/qemu-iotests/267                             |   1 +
tests/qemu-iotests/271.out                         |  14 +-
tests/qemu-iotests/274                             |   3 +-
tests/qemu-iotests/280                             |   1 +
tests/qemu-iotests/281                             |   3 +-
tests/qemu-iotests/283                             |   1 +
tests/qemu-iotests/286                             |   1 +
tests/qemu-iotests/289.out                         |   2 +-
tests/qemu-iotests/298                             |   3 +-
tests/qemu-iotests/300                             |   3 +-
tests/qemu-iotests/304                             |   3 +-
tests/qemu-iotests/305.out                         |   2 +-
tests/qemu-iotests/307.out                         |   2 +-
tests/qemu-iotests/310                             |   3 +-
tests/qemu-iotests/common.rc                       |   8 +
tests/qemu-iotests/iotests.py                      |  32 +-
tests/qemu-iotests/tests/backup-discard-source     |   7 +-
tests/qemu-iotests/tests/copy-before-write         |  69 ++--
tests/qemu-iotests/tests/file-io-error.out         |   2 +-
tests/qemu-iotests/tests/image-fleecing            |   3 +-
tests/qemu-iotests/tests/image-fleecing.out        |  12 +-
tests/qemu-iotests/tests/inactive-node-nbd.out     |   8 +-
tests/qemu-iotests/tests/iothreads-create          |   3 +-
tests/qemu-iotests/tests/luks-detached-header      |   3 +-
.../tests/migrate-bitmaps-postcopy-test            |   3 +-
tests/qemu-iotests/tests/migrate-bitmaps-test      |   3 +-
tests/qemu-iotests/tests/mirror-change-copy-mode   |   3 +-
tests/qemu-iotests/tests/mirror-ready-cancel-error |   3 +-
tests/qemu-iotests/tests/qcow2-internal-snapshots  |   1 +
tests/qemu-iotests/tests/qsd-migrate               |   3 +-
tests/qemu-iotests/tests/reopen-file               |   3 +-
tests/qemu-iotests/tests/write-zeroes-unmap        |   1 +
tests/qtest/ahci-test.c                            |   5 +-
tests/qtest/cdrom-test.c                           |  29 +-
tests/qtest/device-introspect-test.c               | 111 ++++--
tests/qtest/drive_del-test.c                       |  25 ++
tests/qtest/ide-test.c                             |   4 +-
tests/qtest/libqtest.c                             |  14 +
tests/qtest/libqtest.h                             |  11 +
tests/qtest/meson.build                            |   8 +-
tests/qtest/netdev-socket.c                        | 143 ++++---
tests/qtest/numa-test.c                            |  63 +++-
tests/qtest/pnv-host-i2c-test.c                    |   2 +-
tests/qtest/pnv-xive2-test.c                       |   2 +-
tests/qtest/qmp-test.c                             |  13 +-
tests/unit/test-util-sockets.c                     |   1 -
tests/vm/basevm.py                                 |  13 +-
tools/qemu-vnc/clipboard.c                         |   4 +-
tools/qemu-vnc/stubs.c                             |   5 -
trace/meson.build                                  |   5 +-
trace/trace-hmp-cmds.c                             |  17 +-
ui/meson.build                                     |   4 +-
ui/ui-hmp-cmds.c                                   | 151 ++++----
util/error-report.c                                |  72 ++--
util/qemu-print.c                                  |  30 +-
255 files changed, 3922 insertions(+), 2938 deletions(-)
create mode 100644 block/monitor/qmp-cmds.c
create mode 100644 monitor/monitor-hmp-internal.h
create mode 100644 stubs/monitor-cur.c
create mode 100644 stubs/monitor-hmp.c
create mode 100644 stubs/qapi-event-emit.c
[GIT PULL 00/50] Make HMP optional
Posted by Marc-André Lureau 4 weeks, 1 day ago
The following changes since commit 0a1ebd448b38afaa118597cbb633dbec24ef74d3:

  tcg/loongarch64: Fix compile issue LoongArch host (2026-08-27 11:04:01 -0700)

are available in the Git repository at:

  https://gitlab.com/marcandre.lureau/qemu.git tags/nohmp-pr-v1

for you to fetch changes up to 7a3647d67a54728e8f88aa0fa7f5e9a98bf06a51:

  gitlab: --disable-hmp in build-without-defaults (2026-08-29 00:41:32 +0400)

----------------------------------------------------------------
Make HMP optional

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

----------------------------------------------------------------
Marc-André Lureau (50):
      build-sys: introduce CONFIG_HMP
      vl: fix -monitor none prefix matching
      hmp: remove 'vcpu' argument from trace-event help
      hmp: fix snapshot_blkdev argument type
      target/i386: decouple cpu_x86_inject_mce() from Monitor
      target/i386: return an error for invalid CPU in hmp_mce()
      system: move gpa2hva() to system memory unit
      monitor: move HMP-only fields from Monitor to MonitorHMP
      tests/functional: use query-version QMP command instead of HMP
      net/qapi: add x-query-usernet command
      python, tests: switch usernet queries from HMP to QMP
      tests/qtest/pnv: drop unnecessary -serial mon:stdio
      tests/qtest/qmp-test: don't depend on human-monitor-command
      tests/qtest/numa-test: replace HMP "info numa" with QMP query-cpus-fast
      tests/qtest/cdrom-test: replace HMP "info block" with QMP query-block
      tests/qtest/device-introspect-test: replace 'info qom-tree'
      tests/qtest/device-introspect-test: restrict test when !CONFIG_HMP
      tests/qemu-iotests/205: fix race in assertExportNotFound
      net: add x-query-network QMP command
      tests/qtest/netdev-socket: replace HMP with x-query-network QMP
      qemu-io: propagate errors through Error API instead of printf
      block: add x-qemu-io QMP command
      qtest: add qemu-io command to the qtest protocol
      qtest/ide-test: convert to use qtest qemu-io command
      tests/qemu-iotests: add qmp_qemu_io()
      tests/qemu-iotests: convert pause/resume_drive() to QMP
      monitor: reject readline monitor when HMP is disabled
      system: guard HMP initialization paths with CONFIG_HMP
      tests: skip HMP-dependent tests when HMP is disabled
      monitor: isolate HMP declarations in hmp.h
      monitor: change HMPCommand cmd to take MonitorHMP
      monitor: make hmp_handle_error() take MonitorHMP
      monitor: add monitor_cur_hmp() helper
      qemu-print: document HMP/QMP behaviour better
      error-report: switch to use monitor_cur_hmp()
      monitor: tighten monitor_set_cpu()/get_cpu()
      monitor: tighten monitor_printf*()
      hexagon: make dump_mmu() take MonitorHMP
      qdev-monitor: make print_dev() callback take MonitorHMP
      qapi: make HMP-specific schema entries conditional on CONFIG_HMP
      Guard HMP command implementations with CONFIG_HMP
      target: guard MonitorDef tables with CONFIG_HMP
      hw: guard BusClass::print_dev with CONFIG_HMP
      hexagon: condition HMP-specific code
      build-sys: make HMP source files conditional on have_hmp
      stubs: split monitor-core stubs into separate compilation units
      monitor: move monitor_hmp_print*() functions to hmp.c
      monitor: move HMP-specific to monitor-hmp-internal.h
      build-sys: add 'hmp' option
      gitlab: --disable-hmp in build-without-defaults

 .gitlab-ci.d/buildtest.yml                         |   1 +
 accel/accel-system.c                               |   3 +
 accel/tcg/monitor.c                                |   3 +
 audio/audio-hmp-cmds.c                             |  10 +-
 audio/meson.build                                  |   4 +-
 backends/cryptodev-hmp-cmds.c                      |  10 +-
 backends/meson.build                               |   5 +-
 block/monitor/block-hmp-cmds.c                     | 341 +++++++----------
 block/monitor/meson.build                          |   5 +-
 block/monitor/qmp-cmds.c                           |  79 ++++
 chardev/char-hmp-cmds.c                            |  36 +-
 chardev/char.c                                     |  11 +-
 chardev/meson.build                                |   5 +-
 disas/disas-mon.c                                  |  11 +-
 disas/meson.build                                  |   4 +-
 docs/devel/style.rst                               |   2 +-
 docs/devel/writing-monitor-commands.rst            |   8 +-
 dump/dump-hmp-cmds.c                               |  12 +-
 dump/meson.build                                   |   5 +-
 gdbstub/system.c                                   |  10 +-
 hmp-commands-info.hx                               |   6 +-
 hmp-commands.hx                                    |   9 +-
 hw/char/virtio-serial-bus.c                        |  21 +-
 hw/core/machine-hmp-cmds.c                         | 263 +++++++------
 hw/core/meson.build                                |   5 +-
 hw/core/sysbus.c                                   |  15 +-
 hw/hexagon/hexagon_tlb.c                           |  87 ++---
 hw/i386/kvm/xen-stubs.c                            |  10 +-
 hw/i386/kvm/xen_evtchn.c                           |  28 +-
 hw/i386/meson.build                                |   4 +-
 hw/i386/sgx-hmp-stub.c                             |   4 +-
 hw/i386/sgx.c                                      |  32 +-
 hw/misc/auxbus.c                                   |  29 +-
 hw/misc/mos6522-stub.c                             |   6 +-
 hw/misc/mos6522.c                                  |   7 +-
 hw/net/meson.build                                 |   4 +-
 hw/net/rocker/rocker-hmp-cmds.c                    | 158 ++++----
 hw/pci/meson.build                                 |   4 +-
 hw/pci/pci-hmp-cmds.c                              | 121 +++---
 hw/pci/pci-internal.h                              |   2 +-
 hw/pci/pci-stub.c                                  |   8 +-
 hw/pci/pci.c                                       |   2 +
 hw/s390x/s390-skeys.c                              |  14 +-
 hw/s390x/s390-stattrib.c                           |  26 +-
 hw/uefi/ovmf-log.c                                 |  10 +-
 hw/usb/bus.c                                       |  21 +-
 hw/usb/host-libusb.c                               |  29 +-
 hw/virtio/meson.build                              |   4 +-
 hw/virtio/virtio-hmp-cmds.c                        | 312 ++++++++--------
 hw/xen/xen-bus.c                                   |  11 +-
 include/block/block-hmp-cmds.h                     |  55 +--
 include/disas/disas.h                              |   4 +-
 include/hw/core/qdev.h                             |   5 +-
 include/hw/core/sysemu-cpu-ops.h                   |   2 +
 include/hw/hexagon/hexagon_tlb.h                   |   5 +-
 include/hw/usb/usb.h                               |   3 +-
 include/monitor/hmp.h                              | 334 +++++++++--------
 include/monitor/monitor.h                          |  21 --
 include/monitor/qdev.h                             |   5 +-
 include/net/net.h                                  |   8 +-
 include/net/slirp.h                                |   8 +-
 include/qemu-io.h                                  |   4 +-
 include/system/memory.h                            |   2 +
 meson.build                                        |   6 +-
 meson_options.txt                                  |   2 +
 migration/dirtyrate.c                              |  52 +--
 migration/meson.build                              |   4 +-
 migration/migration-hmp-cmds.c                     | 363 +++++++++---------
 monitor/hmp-cmds.c                                 | 290 +++++++--------
 monitor/hmp.c                                      | 257 +++++++------
 monitor/meson.build                                |   9 +-
 monitor/monitor-hmp-internal.h                     | 106 ++++++
 monitor/monitor-internal.h                         | 104 ------
 monitor/monitor.c                                  |  76 ++--
 monitor/qmp-cmds.c                                 |   5 +-
 net/hub.c                                          |  29 +-
 net/hub.h                                          |   4 +-
 net/meson.build                                    |   4 +-
 net/net-hmp-cmds.c                                 |  85 +++--
 net/net.c                                          |  70 +++-
 net/slirp.c                                        |  70 ++--
 python/qemu/utils/__init__.py                      |   5 +-
 qapi/block.json                                    |  34 ++
 qapi/control.json                                  |   4 +-
 qapi/misc.json                                     |   3 +-
 qapi/net.json                                      | 166 +++++++++
 qemu-io-cmds.c                                     | 414 +++++++++++----------
 qemu-io.c                                          |  17 +-
 qemu-options.hx                                    |   6 +-
 qom/meson.build                                    |   4 +-
 qom/qom-hmp-cmds.c                                 |  46 +--
 replay/replay-debugging.c                          |  20 +-
 replay/stubs-system.c                              |  14 +-
 scripts/meson-buildoptions.sh                      |   3 +
 stats/meson.build                                  |   5 +-
 stats/stats-hmp-cmds.c                             |  60 +--
 stubs/hmp-cmd-info_sev.c                           |   4 +-
 stubs/meson.build                                  |  15 +-
 stubs/monitor-core.c                               |  21 +-
 stubs/monitor-cur.c                                |  14 +
 stubs/monitor-hmp.c                                |   9 +
 stubs/monitor-internal.c                           |   4 +-
 stubs/qapi-event-emit.c                            |   8 +
 system/dirtylimit-hmp-cmds.c                       |  20 +-
 system/meson.build                                 |  11 +-
 system/physmem.c                                   |  31 ++
 system/qdev-monitor.c                              |  39 +-
 system/qtest.c                                     |  14 +
 system/runstate-hmp-cmds.c                         |  22 +-
 system/tpm-hmp-cmds.c                              |  30 +-
 system/vl.c                                        |   4 +-
 target/hexagon/hex_mmu.c                           |   6 +-
 target/hexagon/hex_mmu.h                           |   3 +-
 target/i386/cpu-apic.c                             |   8 +-
 target/i386/cpu.c                                  |   8 +-
 target/i386/cpu.h                                  |   4 +-
 target/i386/helper.c                               |  49 +--
 target/i386/kvm/kvm.c                              |   4 +-
 target/i386/monitor.c                              | 173 ++++-----
 target/i386/sev.c                                  |  38 +-
 target/m68k/cpu.c                                  |   4 +
 target/m68k/monitor.c                              |   8 +-
 target/ppc/monitor.c                               |   8 +-
 target/riscv/monitor.c                             |  61 +--
 target/rx/disas.c                                  |   1 +
 target/sh4/monitor.c                               |  34 +-
 target/sparc/cpu.c                                 |   5 +-
 target/sparc/monitor.c                             |   8 +-
 target/xtensa/monitor.c                            |   8 +-
 tests/functional/generic/test_version.py           |  10 +-
 tests/functional/qemu_test/utils.py                |   8 +-
 tests/qemu-iotests/004.out                         |  20 +-
 tests/qemu-iotests/021.out                         |  60 +--
 tests/qemu-iotests/026.out                         | 228 ++++++------
 tests/qemu-iotests/028                             |   1 +
 tests/qemu-iotests/045                             |   3 +-
 tests/qemu-iotests/051                             |   1 +
 tests/qemu-iotests/056                             |   3 +-
 tests/qemu-iotests/060                             |   1 +
 tests/qemu-iotests/060.out                         |  44 ++-
 tests/qemu-iotests/068                             |   1 +
 tests/qemu-iotests/071                             |   1 +
 tests/qemu-iotests/071.out                         |  10 +-
 tests/qemu-iotests/072.out                         |   2 +-
 tests/qemu-iotests/080.out                         |   4 +-
 tests/qemu-iotests/081                             |   1 +
 tests/qemu-iotests/081.out                         |   2 +-
 tests/qemu-iotests/083.out                         |  36 +-
 tests/qemu-iotests/089.out                         |   4 +-
 tests/qemu-iotests/091                             |   1 +
 tests/qemu-iotests/093                             |   3 +-
 tests/qemu-iotests/102                             |   1 +
 tests/qemu-iotests/114.out                         |   2 +-
 tests/qemu-iotests/117                             |   1 +
 tests/qemu-iotests/119                             |   1 +
 tests/qemu-iotests/120                             |   1 +
 tests/qemu-iotests/124                             |   3 +-
 tests/qemu-iotests/130                             |   1 +
 tests/qemu-iotests/132                             |   3 +-
 tests/qemu-iotests/134.out                         |   2 +-
 tests/qemu-iotests/136                             |   3 +-
 tests/qemu-iotests/137.out                         |   2 +-
 tests/qemu-iotests/142                             |   1 +
 tests/qemu-iotests/145                             |   1 +
 tests/qemu-iotests/146                             |   1 +
 tests/qemu-iotests/148                             |   3 +-
 tests/qemu-iotests/151                             |   3 +-
 tests/qemu-iotests/152                             |   3 +-
 tests/qemu-iotests/153                             |   1 +
 tests/qemu-iotests/153.out                         |  12 +-
 tests/qemu-iotests/156                             |   1 +
 tests/qemu-iotests/157                             |   1 +
 tests/qemu-iotests/161                             |   1 +
 tests/qemu-iotests/165                             |   3 +-
 tests/qemu-iotests/171                             |   2 +-
 tests/qemu-iotests/171.out                         |  68 ++--
 tests/qemu-iotests/172                             |   1 +
 tests/qemu-iotests/181                             |   1 +
 tests/qemu-iotests/185                             |   1 +
 tests/qemu-iotests/186                             |   1 +
 tests/qemu-iotests/192                             |   1 +
 tests/qemu-iotests/201                             |   1 +
 tests/qemu-iotests/205                             |   6 +-
 tests/qemu-iotests/214.out                         |   2 +-
 tests/qemu-iotests/216                             |   3 +-
 tests/qemu-iotests/220.out                         |   2 +-
 tests/qemu-iotests/225                             |   1 +
 tests/qemu-iotests/225.out                         |   4 +-
 tests/qemu-iotests/232                             |   1 +
 tests/qemu-iotests/236                             |   3 +-
 tests/qemu-iotests/244.out                         |  12 +-
 tests/qemu-iotests/245                             |   3 +-
 tests/qemu-iotests/246                             |   3 +-
 tests/qemu-iotests/249                             |   1 +
 tests/qemu-iotests/249.out                         |   6 +-
 tests/qemu-iotests/254                             |   3 +-
 tests/qemu-iotests/255                             |   3 +-
 tests/qemu-iotests/257                             |   3 +-
 tests/qemu-iotests/260                             |   3 +-
 tests/qemu-iotests/264                             |   3 +-
 tests/qemu-iotests/267                             |   1 +
 tests/qemu-iotests/271.out                         |  14 +-
 tests/qemu-iotests/274                             |   3 +-
 tests/qemu-iotests/280                             |   1 +
 tests/qemu-iotests/281                             |   3 +-
 tests/qemu-iotests/283                             |   1 +
 tests/qemu-iotests/286                             |   1 +
 tests/qemu-iotests/289.out                         |   2 +-
 tests/qemu-iotests/298                             |   3 +-
 tests/qemu-iotests/300                             |   3 +-
 tests/qemu-iotests/304                             |   3 +-
 tests/qemu-iotests/305.out                         |   2 +-
 tests/qemu-iotests/307.out                         |   2 +-
 tests/qemu-iotests/310                             |   3 +-
 tests/qemu-iotests/common.rc                       |   8 +
 tests/qemu-iotests/iotests.py                      |  32 +-
 tests/qemu-iotests/tests/backup-discard-source     |   7 +-
 tests/qemu-iotests/tests/copy-before-write         |  69 ++--
 tests/qemu-iotests/tests/file-io-error.out         |   2 +-
 tests/qemu-iotests/tests/image-fleecing            |   3 +-
 tests/qemu-iotests/tests/image-fleecing.out        |  12 +-
 tests/qemu-iotests/tests/inactive-node-nbd.out     |   8 +-
 tests/qemu-iotests/tests/iothreads-create          |   3 +-
 tests/qemu-iotests/tests/luks-detached-header      |   3 +-
 .../tests/migrate-bitmaps-postcopy-test            |   3 +-
 tests/qemu-iotests/tests/migrate-bitmaps-test      |   3 +-
 tests/qemu-iotests/tests/mirror-change-copy-mode   |   3 +-
 tests/qemu-iotests/tests/mirror-ready-cancel-error |   3 +-
 tests/qemu-iotests/tests/qcow2-internal-snapshots  |   1 +
 tests/qemu-iotests/tests/qsd-migrate               |   3 +-
 tests/qemu-iotests/tests/reopen-file               |   3 +-
 tests/qemu-iotests/tests/write-zeroes-unmap        |   1 +
 tests/qtest/ahci-test.c                            |   5 +-
 tests/qtest/cdrom-test.c                           |  29 +-
 tests/qtest/device-introspect-test.c               | 111 ++++--
 tests/qtest/drive_del-test.c                       |  25 ++
 tests/qtest/ide-test.c                             |   4 +-
 tests/qtest/libqtest.c                             |  14 +
 tests/qtest/libqtest.h                             |  11 +
 tests/qtest/meson.build                            |   8 +-
 tests/qtest/netdev-socket.c                        | 143 ++++---
 tests/qtest/numa-test.c                            |  63 +++-
 tests/qtest/pnv-host-i2c-test.c                    |   2 +-
 tests/qtest/pnv-xive2-test.c                       |   2 +-
 tests/qtest/qmp-test.c                             |  13 +-
 tests/unit/test-util-sockets.c                     |   1 -
 tests/vm/basevm.py                                 |  13 +-
 tools/qemu-vnc/clipboard.c                         |   4 +-
 tools/qemu-vnc/stubs.c                             |   5 -
 trace/meson.build                                  |   5 +-
 trace/trace-hmp-cmds.c                             |  17 +-
 ui/meson.build                                     |   4 +-
 ui/ui-hmp-cmds.c                                   | 151 ++++----
 util/error-report.c                                |  72 ++--
 util/qemu-print.c                                  |  30 +-
 255 files changed, 3922 insertions(+), 2938 deletions(-)
 create mode 100644 block/monitor/qmp-cmds.c
 create mode 100644 monitor/monitor-hmp-internal.h
 create mode 100644 stubs/monitor-cur.c
 create mode 100644 stubs/monitor-hmp.c
 create mode 100644 stubs/qapi-event-emit.c


[GIT PULL v2 00/50] Make HMP optional
Posted by marcandre.lureau@redhat.com 4 weeks ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

The following changes since commit d2e570cc0f97b936902a5b1b86b73c0f5998b475:

  Merge tag 'pull-ppc-for-11.2-20260828' of https://gitlab.com/harshpb/qemu into staging (2026-08-28 15:17:04 -0700)

are available in the Git repository at:

  https://gitlab.com/marcandre.lureau/qemu.git tags/nohmp-pr-v2

for you to fetch changes up to 7ef933e532a5f86778a16f5b0074f1c2d7b87459:

  gitlab: --disable-hmp in build-without-defaults (2026-08-29 12:08:21 +0400)

----------------------------------------------------------------
Make HMP optional
v2:
 - rebased, skip one new test

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

----------------------------------------------------------------
Marc-André Lureau (50):
      build-sys: introduce CONFIG_HMP
      vl: fix -monitor none prefix matching
      hmp: remove 'vcpu' argument from trace-event help
      hmp: fix snapshot_blkdev argument type
      target/i386: decouple cpu_x86_inject_mce() from Monitor
      target/i386: return an error for invalid CPU in hmp_mce()
      system: move gpa2hva() to system memory unit
      monitor: move HMP-only fields from Monitor to MonitorHMP
      tests/functional: use query-version QMP command instead of HMP
      net/qapi: add x-query-usernet command
      python, tests: switch usernet queries from HMP to QMP
      tests/qtest/pnv: drop unnecessary -serial mon:stdio
      tests/qtest/qmp-test: don't depend on human-monitor-command
      tests/qtest/numa-test: replace HMP "info numa" with QMP query-cpus-fast
      tests/qtest/cdrom-test: replace HMP "info block" with QMP query-block
      tests/qtest/device-introspect-test: replace 'info qom-tree'
      tests/qtest/device-introspect-test: restrict test when !CONFIG_HMP
      tests/qemu-iotests/205: fix race in assertExportNotFound
      net: add x-query-network QMP command
      tests/qtest/netdev-socket: replace HMP with x-query-network QMP
      qemu-io: propagate errors through Error API instead of printf
      block: add x-qemu-io QMP command
      qtest: add qemu-io command to the qtest protocol
      qtest/ide-test: convert to use qtest qemu-io command
      tests/qemu-iotests: add qmp_qemu_io()
      tests/qemu-iotests: convert pause/resume_drive() to QMP
      monitor: reject readline monitor when HMP is disabled
      system: guard HMP initialization paths with CONFIG_HMP
      tests: skip HMP-dependent tests when HMP is disabled
      monitor: isolate HMP declarations in hmp.h
      monitor: change HMPCommand cmd to take MonitorHMP
      monitor: make hmp_handle_error() take MonitorHMP
      monitor: add monitor_cur_hmp() helper
      qemu-print: document HMP/QMP behaviour better
      error-report: switch to use monitor_cur_hmp()
      monitor: tighten monitor_set_cpu()/get_cpu()
      monitor: tighten monitor_printf*()
      hexagon: make dump_mmu() take MonitorHMP
      qdev-monitor: make print_dev() callback take MonitorHMP
      qapi: make HMP-specific schema entries conditional on CONFIG_HMP
      Guard HMP command implementations with CONFIG_HMP
      target: guard MonitorDef tables with CONFIG_HMP
      hw: guard BusClass::print_dev with CONFIG_HMP
      hexagon: condition HMP-specific code
      build-sys: make HMP source files conditional on have_hmp
      stubs: split monitor-core stubs into separate compilation units
      monitor: move monitor_hmp_print*() functions to hmp.c
      monitor: move HMP-specific to monitor-hmp-internal.h
      build-sys: add 'hmp' option
      gitlab: --disable-hmp in build-without-defaults

 .gitlab-ci.d/buildtest.yml                         |   1 +
 accel/accel-system.c                               |   3 +
 accel/tcg/monitor.c                                |   3 +
 audio/audio-hmp-cmds.c                             |  10 +-
 audio/meson.build                                  |   4 +-
 backends/cryptodev-hmp-cmds.c                      |  10 +-
 backends/meson.build                               |   5 +-
 block/monitor/block-hmp-cmds.c                     | 341 +++++++----------
 block/monitor/meson.build                          |   5 +-
 block/monitor/qmp-cmds.c                           |  79 ++++
 chardev/char-hmp-cmds.c                            |  36 +-
 chardev/char.c                                     |  11 +-
 chardev/meson.build                                |   5 +-
 disas/disas-mon.c                                  |  11 +-
 disas/meson.build                                  |   4 +-
 docs/devel/style.rst                               |   2 +-
 docs/devel/writing-monitor-commands.rst            |   8 +-
 dump/dump-hmp-cmds.c                               |  12 +-
 dump/meson.build                                   |   5 +-
 gdbstub/system.c                                   |  10 +-
 hmp-commands-info.hx                               |   6 +-
 hmp-commands.hx                                    |   9 +-
 hw/char/virtio-serial-bus.c                        |  21 +-
 hw/core/machine-hmp-cmds.c                         | 263 +++++++------
 hw/core/meson.build                                |   5 +-
 hw/core/sysbus.c                                   |  15 +-
 hw/hexagon/hexagon_tlb.c                           |  87 ++---
 hw/i386/kvm/xen-stubs.c                            |  10 +-
 hw/i386/kvm/xen_evtchn.c                           |  28 +-
 hw/i386/meson.build                                |   4 +-
 hw/i386/sgx-hmp-stub.c                             |   4 +-
 hw/i386/sgx.c                                      |  32 +-
 hw/misc/auxbus.c                                   |  29 +-
 hw/misc/mos6522-stub.c                             |   6 +-
 hw/misc/mos6522.c                                  |   7 +-
 hw/net/meson.build                                 |   4 +-
 hw/net/rocker/rocker-hmp-cmds.c                    | 158 ++++----
 hw/pci/meson.build                                 |   4 +-
 hw/pci/pci-hmp-cmds.c                              | 121 +++---
 hw/pci/pci-internal.h                              |   2 +-
 hw/pci/pci-stub.c                                  |   8 +-
 hw/pci/pci.c                                       |   2 +
 hw/s390x/s390-skeys.c                              |  14 +-
 hw/s390x/s390-stattrib.c                           |  26 +-
 hw/uefi/ovmf-log.c                                 |  10 +-
 hw/usb/bus.c                                       |  21 +-
 hw/usb/host-libusb.c                               |  29 +-
 hw/virtio/meson.build                              |   4 +-
 hw/virtio/virtio-hmp-cmds.c                        | 312 ++++++++--------
 hw/xen/xen-bus.c                                   |  11 +-
 include/block/block-hmp-cmds.h                     |  55 +--
 include/disas/disas.h                              |   4 +-
 include/hw/core/qdev.h                             |   5 +-
 include/hw/core/sysemu-cpu-ops.h                   |   2 +
 include/hw/hexagon/hexagon_tlb.h                   |   5 +-
 include/hw/usb/usb.h                               |   3 +-
 include/monitor/hmp.h                              | 334 +++++++++--------
 include/monitor/monitor.h                          |  21 --
 include/monitor/qdev.h                             |   5 +-
 include/net/net.h                                  |   8 +-
 include/net/slirp.h                                |   8 +-
 include/qemu-io.h                                  |   4 +-
 include/system/memory.h                            |   2 +
 meson.build                                        |   6 +-
 meson_options.txt                                  |   2 +
 migration/dirtyrate.c                              |  52 +--
 migration/meson.build                              |   4 +-
 migration/migration-hmp-cmds.c                     | 363 +++++++++---------
 monitor/hmp-cmds.c                                 | 290 +++++++--------
 monitor/hmp.c                                      | 257 +++++++------
 monitor/meson.build                                |   9 +-
 monitor/monitor-hmp-internal.h                     | 106 ++++++
 monitor/monitor-internal.h                         | 104 ------
 monitor/monitor.c                                  |  76 ++--
 monitor/qmp-cmds.c                                 |   5 +-
 net/hub.c                                          |  29 +-
 net/hub.h                                          |   4 +-
 net/meson.build                                    |   4 +-
 net/net-hmp-cmds.c                                 |  85 +++--
 net/net.c                                          |  70 +++-
 net/slirp.c                                        |  70 ++--
 python/qemu/utils/__init__.py                      |   5 +-
 qapi/block.json                                    |  34 ++
 qapi/control.json                                  |   4 +-
 qapi/misc.json                                     |   3 +-
 qapi/net.json                                      | 166 +++++++++
 qemu-io-cmds.c                                     | 414 +++++++++++----------
 qemu-io.c                                          |  17 +-
 qemu-options.hx                                    |   6 +-
 qom/meson.build                                    |   4 +-
 qom/qom-hmp-cmds.c                                 |  46 +--
 replay/replay-debugging.c                          |  20 +-
 replay/stubs-system.c                              |  14 +-
 scripts/meson-buildoptions.sh                      |   3 +
 stats/meson.build                                  |   5 +-
 stats/stats-hmp-cmds.c                             |  60 +--
 stubs/hmp-cmd-info_sev.c                           |   4 +-
 stubs/meson.build                                  |  15 +-
 stubs/monitor-core.c                               |  21 +-
 stubs/monitor-cur.c                                |  14 +
 stubs/monitor-hmp.c                                |   9 +
 stubs/monitor-internal.c                           |   4 +-
 stubs/qapi-event-emit.c                            |   8 +
 system/dirtylimit-hmp-cmds.c                       |  20 +-
 system/meson.build                                 |  11 +-
 system/physmem.c                                   |  31 ++
 system/qdev-monitor.c                              |  39 +-
 system/qtest.c                                     |  14 +
 system/runstate-hmp-cmds.c                         |  22 +-
 system/tpm-hmp-cmds.c                              |  30 +-
 system/vl.c                                        |   4 +-
 target/hexagon/hex_mmu.c                           |   6 +-
 target/hexagon/hex_mmu.h                           |   3 +-
 target/i386/cpu-apic.c                             |   8 +-
 target/i386/cpu.c                                  |   8 +-
 target/i386/cpu.h                                  |   4 +-
 target/i386/helper.c                               |  49 +--
 target/i386/kvm/kvm.c                              |   4 +-
 target/i386/monitor.c                              | 173 ++++-----
 target/i386/sev.c                                  |  38 +-
 target/m68k/cpu.c                                  |   4 +
 target/m68k/monitor.c                              |   8 +-
 target/ppc/monitor.c                               |   8 +-
 target/riscv/monitor.c                             |  61 +--
 target/rx/disas.c                                  |   1 +
 target/sh4/monitor.c                               |  34 +-
 target/sparc/cpu.c                                 |   5 +-
 target/sparc/monitor.c                             |   8 +-
 target/xtensa/monitor.c                            |   8 +-
 tests/functional/generic/test_version.py           |  10 +-
 tests/functional/qemu_test/utils.py                |   8 +-
 tests/qemu-iotests/004.out                         |  20 +-
 tests/qemu-iotests/021.out                         |  60 +--
 tests/qemu-iotests/026.out                         | 228 ++++++------
 tests/qemu-iotests/028                             |   1 +
 tests/qemu-iotests/045                             |   3 +-
 tests/qemu-iotests/051                             |   1 +
 tests/qemu-iotests/056                             |   3 +-
 tests/qemu-iotests/060                             |   1 +
 tests/qemu-iotests/060.out                         |  44 ++-
 tests/qemu-iotests/068                             |   1 +
 tests/qemu-iotests/071                             |   1 +
 tests/qemu-iotests/071.out                         |  10 +-
 tests/qemu-iotests/072.out                         |   2 +-
 tests/qemu-iotests/080.out                         |   4 +-
 tests/qemu-iotests/081                             |   1 +
 tests/qemu-iotests/081.out                         |   2 +-
 tests/qemu-iotests/083.out                         |  36 +-
 tests/qemu-iotests/089.out                         |   4 +-
 tests/qemu-iotests/091                             |   1 +
 tests/qemu-iotests/093                             |   3 +-
 tests/qemu-iotests/102                             |   1 +
 tests/qemu-iotests/114.out                         |   2 +-
 tests/qemu-iotests/117                             |   1 +
 tests/qemu-iotests/119                             |   1 +
 tests/qemu-iotests/120                             |   1 +
 tests/qemu-iotests/124                             |   3 +-
 tests/qemu-iotests/130                             |   1 +
 tests/qemu-iotests/132                             |   3 +-
 tests/qemu-iotests/134.out                         |   2 +-
 tests/qemu-iotests/136                             |   3 +-
 tests/qemu-iotests/137.out                         |   2 +-
 tests/qemu-iotests/142                             |   1 +
 tests/qemu-iotests/145                             |   1 +
 tests/qemu-iotests/146                             |   1 +
 tests/qemu-iotests/148                             |   3 +-
 tests/qemu-iotests/151                             |   3 +-
 tests/qemu-iotests/152                             |   3 +-
 tests/qemu-iotests/153                             |   1 +
 tests/qemu-iotests/153.out                         |  12 +-
 tests/qemu-iotests/156                             |   1 +
 tests/qemu-iotests/157                             |   1 +
 tests/qemu-iotests/161                             |   1 +
 tests/qemu-iotests/165                             |   3 +-
 tests/qemu-iotests/171                             |   2 +-
 tests/qemu-iotests/171.out                         |  68 ++--
 tests/qemu-iotests/172                             |   1 +
 tests/qemu-iotests/181                             |   1 +
 tests/qemu-iotests/185                             |   1 +
 tests/qemu-iotests/186                             |   1 +
 tests/qemu-iotests/192                             |   1 +
 tests/qemu-iotests/201                             |   1 +
 tests/qemu-iotests/205                             |   6 +-
 tests/qemu-iotests/214.out                         |   2 +-
 tests/qemu-iotests/216                             |   3 +-
 tests/qemu-iotests/220.out                         |   2 +-
 tests/qemu-iotests/225                             |   1 +
 tests/qemu-iotests/225.out                         |   4 +-
 tests/qemu-iotests/232                             |   1 +
 tests/qemu-iotests/236                             |   3 +-
 tests/qemu-iotests/244.out                         |  12 +-
 tests/qemu-iotests/245                             |   3 +-
 tests/qemu-iotests/246                             |   3 +-
 tests/qemu-iotests/249                             |   1 +
 tests/qemu-iotests/249.out                         |   6 +-
 tests/qemu-iotests/254                             |   3 +-
 tests/qemu-iotests/255                             |   3 +-
 tests/qemu-iotests/257                             |   3 +-
 tests/qemu-iotests/260                             |   3 +-
 tests/qemu-iotests/264                             |   3 +-
 tests/qemu-iotests/267                             |   1 +
 tests/qemu-iotests/271.out                         |  14 +-
 tests/qemu-iotests/274                             |   3 +-
 tests/qemu-iotests/280                             |   1 +
 tests/qemu-iotests/281                             |   3 +-
 tests/qemu-iotests/283                             |   1 +
 tests/qemu-iotests/286                             |   1 +
 tests/qemu-iotests/289.out                         |   2 +-
 tests/qemu-iotests/298                             |   3 +-
 tests/qemu-iotests/300                             |   3 +-
 tests/qemu-iotests/304                             |   3 +-
 tests/qemu-iotests/305.out                         |   2 +-
 tests/qemu-iotests/307.out                         |   2 +-
 tests/qemu-iotests/310                             |   3 +-
 tests/qemu-iotests/common.rc                       |   8 +
 tests/qemu-iotests/iotests.py                      |  32 +-
 tests/qemu-iotests/tests/backup-discard-source     |   7 +-
 tests/qemu-iotests/tests/copy-before-write         |  69 ++--
 tests/qemu-iotests/tests/file-io-error.out         |   2 +-
 tests/qemu-iotests/tests/image-fleecing            |   3 +-
 tests/qemu-iotests/tests/image-fleecing.out        |  12 +-
 tests/qemu-iotests/tests/inactive-node-nbd.out     |   8 +-
 tests/qemu-iotests/tests/iothreads-create          |   3 +-
 tests/qemu-iotests/tests/luks-detached-header      |   3 +-
 .../tests/migrate-bitmaps-postcopy-test            |   3 +-
 tests/qemu-iotests/tests/migrate-bitmaps-test      |   3 +-
 tests/qemu-iotests/tests/mirror-change-copy-mode   |   3 +-
 tests/qemu-iotests/tests/mirror-ready-cancel-error |   3 +-
 tests/qemu-iotests/tests/qcow2-internal-snapshots  |   1 +
 tests/qemu-iotests/tests/qsd-migrate               |   3 +-
 tests/qemu-iotests/tests/reopen-file               |   3 +-
 tests/qemu-iotests/tests/write-zeroes-unmap        |   1 +
 tests/qtest/ahci-test.c                            |   5 +-
 tests/qtest/cdrom-test.c                           |  29 +-
 tests/qtest/device-introspect-test.c               | 111 ++++--
 tests/qtest/drive_del-test.c                       |  25 ++
 tests/qtest/ide-test.c                             |   8 +-
 tests/qtest/libqtest.c                             |  14 +
 tests/qtest/libqtest.h                             |  11 +
 tests/qtest/meson.build                            |   8 +-
 tests/qtest/netdev-socket.c                        | 143 ++++---
 tests/qtest/numa-test.c                            |  63 +++-
 tests/qtest/pnv-host-i2c-test.c                    |   2 +-
 tests/qtest/pnv-xive2-test.c                       |   2 +-
 tests/qtest/qmp-test.c                             |  13 +-
 tests/unit/test-util-sockets.c                     |   1 -
 tests/vm/basevm.py                                 |  13 +-
 tools/qemu-vnc/clipboard.c                         |   4 +-
 tools/qemu-vnc/stubs.c                             |   5 -
 trace/meson.build                                  |   5 +-
 trace/trace-hmp-cmds.c                             |  17 +-
 ui/meson.build                                     |   4 +-
 ui/ui-hmp-cmds.c                                   | 151 ++++----
 util/error-report.c                                |  72 ++--
 util/qemu-print.c                                  |  30 +-
 255 files changed, 3926 insertions(+), 2938 deletions(-)
 create mode 100644 block/monitor/qmp-cmds.c
 create mode 100644 monitor/monitor-hmp-internal.h
 create mode 100644 stubs/monitor-cur.c
 create mode 100644 stubs/monitor-hmp.c
 create mode 100644 stubs/qapi-event-emit.c

Re: [GIT PULL v2 00/50] Make HMP optional
Posted by Peter Maydell 3 weeks, 4 days ago
On Sat, 29 Aug 2026 at 10:15, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The following changes since commit d2e570cc0f97b936902a5b1b86b73c0f5998b475:
>
>   Merge tag 'pull-ppc-for-11.2-20260828' of https://gitlab.com/harshpb/qemu into staging (2026-08-28 15:17:04 -0700)
>
> are available in the Git repository at:
>
>   https://gitlab.com/marcandre.lureau/qemu.git tags/nohmp-pr-v2
>
> for you to fetch changes up to 7ef933e532a5f86778a16f5b0074f1c2d7b87459:
>
>   gitlab: --disable-hmp in build-without-defaults (2026-08-29 12:08:21 +0400)
>
> ----------------------------------------------------------------
> Make HMP optional
> v2:
>  - rebased, skip one new test
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>

This still fails "make check" on a local "--without-hmp" build:

 118/1082 qtest+qtest-i386+slow - qemu:qtest-i386/ahci-test
                ERROR            4.86s   killed by signal 6 SIGABRT
 119/1082 qtest+qtest-x86_64+slow - qemu:qtest-x86_64/ahci-test
                ERROR            5.58s   killed by signal 6 SIGABRT

Assertion failure is
 ERROR:../../tests/qtest/libqtest.c:998:qtest_vhmp: assertion failed: (ret)

"make check-functional" also fails:

 23/361 func-thorough+func-s390x-thorough+thorough -
qemu:func-s390x-ccw_virtio               FAIL             22.99s
exit status 1
292/361 func-thorough+func-m68k-thorough+thorough -
qemu:func-m68k-nextcube                   FAIL              0.17s
exit status 1
311/361 func-thorough+func-ppc-thorough+thorough - qemu:func-ppc-ppe42
                       FAIL              0.20s   exit status 1
359/361 func-thorough+func-x86_64-thorough+thorough -
qemu:func-x86_64-nvme_migration         FAIL             34.99s   exit
status 1

The first three all fail because the test does
 self.vm.cmd('human-monitor-command', command_line='something')
and this throws an exception. I think the nvme one is unrelated
and is probably some existing intermittent failure.

This suggests we need to add coverage of this config to CI.

thanks
-- PMM
Re: [GIT PULL v2 00/50] Make HMP optional
Posted by Marc-André Lureau 3 weeks, 4 days ago
Hi

On Tue, Sep 1, 2026 at 1:10 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Sat, 29 Aug 2026 at 10:15, <marcandre.lureau@redhat.com> wrote:
> >
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > The following changes since commit d2e570cc0f97b936902a5b1b86b73c0f5998b475:
> >
> >   Merge tag 'pull-ppc-for-11.2-20260828' of https://gitlab.com/harshpb/qemu into staging (2026-08-28 15:17:04 -0700)
> >
> > are available in the Git repository at:
> >
> >   https://gitlab.com/marcandre.lureau/qemu.git tags/nohmp-pr-v2
> >
> > for you to fetch changes up to 7ef933e532a5f86778a16f5b0074f1c2d7b87459:
> >
> >   gitlab: --disable-hmp in build-without-defaults (2026-08-29 12:08:21 +0400)
> >
> > ----------------------------------------------------------------
> > Make HMP optional
> > v2:
> >  - rebased, skip one new test
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
>
> This still fails "make check" on a local "--without-hmp" build:
>
>  118/1082 qtest+qtest-i386+slow - qemu:qtest-i386/ahci-test
>                 ERROR            4.86s   killed by signal 6 SIGABRT
>  119/1082 qtest+qtest-x86_64+slow - qemu:qtest-x86_64/ahci-test
>                 ERROR            5.58s   killed by signal 6 SIGABRT
>
> Assertion failure is
>  ERROR:../../tests/qtest/libqtest.c:998:qtest_vhmp: assertion failed: (ret)
>
> "make check-functional" also fails:
>
>  23/361 func-thorough+func-s390x-thorough+thorough -
> qemu:func-s390x-ccw_virtio               FAIL             22.99s
> exit status 1
> 292/361 func-thorough+func-m68k-thorough+thorough -
> qemu:func-m68k-nextcube                   FAIL              0.17s
> exit status 1
> 311/361 func-thorough+func-ppc-thorough+thorough - qemu:func-ppc-ppe42
>                        FAIL              0.20s   exit status 1
> 359/361 func-thorough+func-x86_64-thorough+thorough -
> qemu:func-x86_64-nvme_migration         FAIL             34.99s   exit
> status 1
>
> The first three all fail because the test does
>  self.vm.cmd('human-monitor-command', command_line='something')
> and this throws an exception. I think the nvme one is unrelated
> and is probably some existing intermittent failure.
>
> This suggests we need to add coverage of this config to CI.

I don't see those failure immediately on my build either.
Can we adress those remaining issues after the merge if it doesn't break CI?

For the records, more tests were converted to QMP in an earlier
version, but left out to make the series easier to merge
Re: [GIT PULL v2 00/50] Make HMP optional
Posted by Peter Maydell 3 weeks, 3 days ago
On Tue, 1 Sept 2026 at 11:18, Marc-André Lureau
<marcandre.lureau@redhat.com> wrote:
>
> Hi
>
> On Tue, Sep 1, 2026 at 1:10 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Sat, 29 Aug 2026 at 10:15, <marcandre.lureau@redhat.com> wrote:
> > >
> > > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >
> > > The following changes since commit d2e570cc0f97b936902a5b1b86b73c0f5998b475:
> > >
> > >   Merge tag 'pull-ppc-for-11.2-20260828' of https://gitlab.com/harshpb/qemu into staging (2026-08-28 15:17:04 -0700)
> > >
> > > are available in the Git repository at:
> > >
> > >   https://gitlab.com/marcandre.lureau/qemu.git tags/nohmp-pr-v2
> > >
> > > for you to fetch changes up to 7ef933e532a5f86778a16f5b0074f1c2d7b87459:
> > >
> > >   gitlab: --disable-hmp in build-without-defaults (2026-08-29 12:08:21 +0400)
> > >
> > > ----------------------------------------------------------------
> > > Make HMP optional
> > > v2:
> > >  - rebased, skip one new test
> > >
> > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >
> >
> > This still fails "make check" on a local "--without-hmp" build:
> >
> >  118/1082 qtest+qtest-i386+slow - qemu:qtest-i386/ahci-test
> >                 ERROR            4.86s   killed by signal 6 SIGABRT
> >  119/1082 qtest+qtest-x86_64+slow - qemu:qtest-x86_64/ahci-test
> >                 ERROR            5.58s   killed by signal 6 SIGABRT
> >
> > Assertion failure is
> >  ERROR:../../tests/qtest/libqtest.c:998:qtest_vhmp: assertion failed: (ret)
> >
> > "make check-functional" also fails:
> >
> >  23/361 func-thorough+func-s390x-thorough+thorough -
> > qemu:func-s390x-ccw_virtio               FAIL             22.99s
> > exit status 1
> > 292/361 func-thorough+func-m68k-thorough+thorough -
> > qemu:func-m68k-nextcube                   FAIL              0.17s
> > exit status 1
> > 311/361 func-thorough+func-ppc-thorough+thorough - qemu:func-ppc-ppe42
> >                        FAIL              0.20s   exit status 1
> > 359/361 func-thorough+func-x86_64-thorough+thorough -
> > qemu:func-x86_64-nvme_migration         FAIL             34.99s   exit
> > status 1
> >
> > The first three all fail because the test does
> >  self.vm.cmd('human-monitor-command', command_line='something')
> > and this throws an exception. I think the nvme one is unrelated
> > and is probably some existing intermittent failure.
> >
> > This suggests we need to add coverage of this config to CI.
>
> I don't see those failure immediately on my build either.

This is a build on Ubuntu 24.04 host with "configure --disable-hmp"
and no other arguments.

> Can we adress those remaining issues after the merge if it doesn't break CI?

OK, I think that's reasonable, so I have merged this PR.
Please do work on fixing the tests and getting some CI coverage
for the --disable-hmp config.

Probably for qtest in a --disable-hmp config the qtest_hmp() and
qtest_vhmp() functions should assert with a useful message, just to
make the failure cause a little clearer than the one you get when
it sends the command to the QEMU instance and gets back the error.
Perhaps they could g_test_skip(), but I'm not sure whether that's
safe to do at that level down in the middle of trying to run a test.
We should also update the doc comments for those two functions to
say "don't use these unless absolutely necessary and you have the
code to skip the test when HMP isn't available" (just in case
anybody writing a new test reads doc comments ;-)).

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/11.2
for any user-visible changes.

-- PMM
Re: [GIT PULL 00/50] Make HMP optional
Posted by Richard Henderson 4 weeks ago
On 8/28/26 13:41, Marc-André Lureau wrote:
> The following changes since commit 0a1ebd448b38afaa118597cbb633dbec24ef74d3:
> 
>    tcg/loongarch64: Fix compile issue LoongArch host (2026-08-27 11:04:01 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/marcandre.lureau/qemu.git tags/nohmp-pr-v1
> 
> for you to fetch changes up to 7a3647d67a54728e8f88aa0fa7f5e9a98bf06a51:
> 
>    gitlab: --disable-hmp in build-without-defaults (2026-08-29 00:41:32 +0400)
> 
> ----------------------------------------------------------------
> Make HMP optional
> 
> Signed-off-by: Marc-André Lureau<marcandre.lureau@redhat.com>

You need to update some tests.  With just "configure --disable-hmp":

▶  178/1056 /x86_64/ide/migration/chs_snapshot - 
ERROR:../publish/tests/qtest/libqtest.c:998:qtest_vhmp: assertion 
failed: (ret) FAIL
▶  178/1056 
                         ERROR
  178/1056 qtest+qtest-x86_64+slow - qemu:qtest-x86_64/ide-test 
                          ERROR            1.61s   killed by signal 6 
SIGABRT
>>>> RUST_BACKTRACE=1 QTEST_QEMU_IMG=./qemu-img PYTHON=/home/rth/qemu/bld-pub/pyvenv/bin/python3 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon G_TEST_DBUS_DAEMON=/home/rth/qemu/publish/tests/dbus-daemon.sh QTEST_QEMU_BINARY=./qemu-system-x86_64 QTEST_QEMU_VNC_BINARY=./tools/qemu-vnc/qemu-vnc ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=40 MESON_TEST_ITERATION=1 /home/rth/qemu/bld-pub/tests/qtest/ide-test --tap -k
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― 
✀ 
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
stderr:
**
ERROR:../publish/tests/qtest/libqtest.c:998:qtest_vhmp: assertion 
failed: (ret)

(test program exited with status code -6)


r~

Re: [GIT PULL 00/50] Make HMP optional
Posted by Marc-André Lureau 4 weeks ago
Hi

On Sat, Aug 29, 2026 at 4:53 AM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 8/28/26 13:41, Marc-André Lureau wrote:
> > The following changes since commit 0a1ebd448b38afaa118597cbb633dbec24ef74d3:
> >
> >    tcg/loongarch64: Fix compile issue LoongArch host (2026-08-27 11:04:01 -0700)
> >
> > are available in the Git repository at:
> >
> >    https://gitlab.com/marcandre.lureau/qemu.git tags/nohmp-pr-v1
> >
> > for you to fetch changes up to 7a3647d67a54728e8f88aa0fa7f5e9a98bf06a51:
> >
> >    gitlab: --disable-hmp in build-without-defaults (2026-08-29 00:41:32 +0400)
> >
> > ----------------------------------------------------------------
> > Make HMP optional
> >
> > Signed-off-by: Marc-André Lureau<marcandre.lureau@redhat.com>
>
> You need to update some tests.  With just "configure --disable-hmp":
>
> ▶  178/1056 /x86_64/ide/migration/chs_snapshot -
> ERROR:../publish/tests/qtest/libqtest.c:998:qtest_vhmp: assertion
> failed: (ret) FAIL
> ▶  178/1056
>                          ERROR
>   178/1056 qtest+qtest-x86_64+slow - qemu:qtest-x86_64/ide-test
>                           ERROR            1.61s   killed by signal 6
> SIGABRT
> >>>> RUST_BACKTRACE=1 QTEST_QEMU_IMG=./qemu-img PYTHON=/home/rth/qemu/bld-pub/pyvenv/bin/python3 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon G_TEST_DBUS_DAEMON=/home/rth/qemu/publish/tests/dbus-daemon.sh QTEST_QEMU_BINARY=./qemu-system-x86_64 QTEST_QEMU_VNC_BINARY=./tools/qemu-vnc/qemu-vnc ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=40 MESON_TEST_ITERATION=1 /home/rth/qemu/bld-pub/tests/qtest/ide-test --tap -k
> ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
> ✀
> ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
> stderr:
> **
> ERROR:../publish/tests/qtest/libqtest.c:998:qtest_vhmp: assertion
> failed: (ret)
>
> (test program exited with status code -6)

It's a new test to skip for now (and convert later), I'll send v2 of
just the cover after CI is all green.