]> git.proxmox.com Git - mirror_qemu.git/commit - qapi/qapi-type-helpers.c
monitor: introduce HumanReadableText and HMP support
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 8 Oct 2021 14:09:00 +0000 (15:09 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 2 Nov 2021 15:55:13 +0000 (15:55 +0000)
commitf9429c6790ce0c9f737d318eeff5c4a24f641ec2
tree418362075b55a83a80e77fea1180434379b6f82d
parent6fa6b54f5b931e10e24f773d991a48da4f79e61a
monitor: introduce HumanReadableText and HMP support

This provides a foundation on which to convert simple HMP commands to
use QMP. The QMP implementation will generate formatted text targeted
for human consumption, returning it in the HumanReadableText data type.

The HMP command handler will simply print out the formatted string
within the HumanReadableText data type. Since this will be an entirely
formulaic action in the case of HMP commands taking no arguments, a
custom command handler is provided.

Thus instead of registering a 'cmd' callback for the HMP command, a
'cmd_info_hrt' callback is provided, which will simply be a pointer
to the QMP implementation.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
include/monitor/hmp.h
include/monitor/monitor.h
include/qapi/type-helpers.h [new file with mode: 0644]
monitor/hmp.c
monitor/misc.c
monitor/monitor-internal.h
qapi/common.json
qapi/meson.build
qapi/qapi-type-helpers.c [new file with mode: 0644]