mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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>
This commit is contained in:
parent
6fa6b54f5b
commit
f9429c6790
9 changed files with 109 additions and 4 deletions
14
include/qapi/type-helpers.h
Normal file
14
include/qapi/type-helpers.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* QAPI common helper functions
|
||||
*
|
||||
* This file provides helper functions related to types defined
|
||||
* in the QAPI schema.
|
||||
*
|
||||
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
|
||||
* See the COPYING.LIB file in the top-level directory.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "qapi/qapi-types-common.h"
|
||||
|
||||
HumanReadableText *human_readable_text_from_str(GString *str);
|
Loading…
Add table
Add a link
Reference in a new issue