mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00: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:
@ -15,6 +15,7 @@
|
||||
#define HMP_H
|
||||
|
||||
#include "qemu/readline.h"
|
||||
#include "qapi/qapi-types-common.h"
|
||||
|
||||
bool hmp_handle_error(Monitor *mon, Error *err);
|
||||
|
||||
@ -130,5 +131,7 @@ void hmp_replay_delete_break(Monitor *mon, const QDict *qdict);
|
||||
void hmp_replay_seek(Monitor *mon, const QDict *qdict);
|
||||
void hmp_info_dirty_rate(Monitor *mon, const QDict *qdict);
|
||||
void hmp_calc_dirty_rate(Monitor *mon, const QDict *qdict);
|
||||
void hmp_human_readable_text_helper(Monitor *mon,
|
||||
HumanReadableText *(*qmp_handler)(Error **));
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user