qemu-s390x
[Top][All Lists]
Advanced

[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',




reply via email to

[Prev in Thread] Current Thread [Next in Thread]