[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 06/22] monitor: introduce HumanReadableText and HMP suppor
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 06/22] monitor: introduce HumanReadableText and HMP support |
Date: |
Thu, 28 Oct 2021 18:54:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 10/28/21 17:54, Daniel P. Berrangé wrote:
> 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 arguemnts, a
Typo "arguments"
> 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.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> include/monitor/hmp.h | 3 +++
> include/monitor/monitor.h | 2 ++
> include/qapi/type-helpers.h | 14 ++++++++++++++
> monitor/hmp.c | 31 ++++++++++++++++++++++++++++---
> monitor/misc.c | 18 +++++++++++++++++-
> monitor/monitor-internal.h | 7 +++++++
> qapi/common.json | 11 +++++++++++
> qapi/meson.build | 3 +++
> qapi/qapi-type-helpers.c | 23 +++++++++++++++++++++++
> 9 files changed, 108 insertions(+), 4 deletions(-)
> create mode 100644 include/qapi/type-helpers.h
> create mode 100644 qapi/qapi-type-helpers.c
> +##
> +# @HumanReadableText:
> +#
> +# @human-readable-text: Formatted output intended for humans.
> +#
> +# Since: 6.2
> +#
> +##
> +{ 'struct': 'HumanReadableText',
> + 'data': { 'human-readable-text': 'str' } }
> diff --git a/qapi/meson.build b/qapi/meson.build
> index c356a385e3..c0c49c15e4 100644
> --- a/qapi/meson.build
> +++ b/qapi/meson.build
> @@ -10,6 +10,9 @@ util_ss.add(files(
> 'string-input-visitor.c',
> 'string-output-visitor.c',
> ))
> +if have_system
> + util_ss.add(files('qapi-type-helpers.c'))
> +endif
> if have_system or have_tools
Eh I was expecting this to be added here, but it seems to build,
so TIL tools don't use HMP.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> util_ss.add(files(
> 'qmp-dispatch.c',
- Re: [PATCH v4 01/22] monitor: remove 'info ioapic' HMP command, (continued)
- [PATCH v4 02/22] monitor: make hmp_handle_error return a boolean, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 03/22] docs/devel: rename file for writing monitor commands, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 04/22] docs/devel: tweak headings in monitor command docs, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 05/22] docs/devel: update error handling guidance for HMP commands, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 06/22] monitor: introduce HumanReadableText and HMP support, Daniel P . Berrangé, 2021/10/28
- Re: [PATCH v4 06/22] monitor: introduce HumanReadableText and HMP support,
Philippe Mathieu-Daudé <=
- [PATCH v4 08/22] docs/devel: add example of command returning unstructured text, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 09/22] docs/devel: document expectations for HMP commands in the future, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 07/22] docs/devel: document expectations for QAPI data modelling for QMP, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 10/22] qapi: introduce x-query-roms QMP command, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 11/22] qapi: introduce x-query-profile QMP command, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 12/22] qapi: introduce x-query-numa QMP command, Daniel P . Berrangé, 2021/10/28
- [PATCH v4 13/22] qapi: introduce x-query-usb QMP command, Daniel P . Berrangé, 2021/10/28