freenode
Databases & Infrastructure

QEMU series makes Human Monitor Protocol optional at build time

Marc-André Lureau’s 50-patch work lets builds drop HMP for a QMP-only binary, shrinking size and attack surface.

Marc-André Lureau has posted a 50-patch series on the QEMU development list that makes the Human Monitor Protocol (HMP) optional at compile time via --disable-hmp. A build without HMP speaks only QMP, reducing binary size and attack surface and enforcing a clearer split between the machine-readable control channel and the interactive debugging console.

HMP has long been QEMU’s text console for operators and developers. Lureau notes that QMP already covers almost everything HMP provided for automation, so a later standalone HMP-like tool could sit on top of QMP. In the meantime, compile-out support is valuable on its own and helps mark what still lacks a proper machine interface.

Gaps he lists are mostly deep introspection and debugging still bound to HMP: register dumps (including register expressions), memory examine, guest/host address translation, architecture-specific APIC, TLB, and virtual-memory views, the memory-region tree, s390x storage-key and CMMA dumps, device and snapshot trees, and several simpler actions such as GDB server control, boot-device selection, MCE injection, slirp port forwarding, and log or trace file control. A future query for disassembly metadata (architecture, endianness) would also help clients do that work themselves.

The series lands the change in stages: preparatory cleanups and type narrowing so HMP-only state is not reached through shared monitor types, QMP coverage for commands tests still need, conversion of most iotests and qtests from HMP to QMP, guards around HMP-only paths and callbacks, and finally conditional build of HMP sources and related qtest coverage. Readline monitor mode and the human-monitor-command wrapper are unavailable when HMP is not compiled in.