aboutsummaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-06-07 12:47:04 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-06-19 12:40:49 +0200
commitb2580720d026fa1591218468891a47f42be6a335 (patch)
treee888b28abf9a055f9e7596a5e95747a9c5917d40 /monitor
parenta58e653aa29cd39a0740af0a9eb3012c27326c3e (diff)
hw/intc: Avoid using Monitor in INTERRUPT_STATS_PROVIDER::print_info()
Replace Monitor API by HumanReadableText one (see commit f2de406f29 "docs/devel: document expectations for QAPI data modelling for QMP" for rationale). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20240610063518.50680-2-philmd@linaro.org>
Diffstat (limited to 'monitor')
-rw-r--r--monitor/hmp-cmds.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index ea79148ee8..fbff7fdb57 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -25,6 +25,7 @@
#include "qapi/qapi-commands-machine.h"
#include "qapi/qapi-commands-misc.h"
#include "qapi/qmp/qdict.h"
+#include "qapi/type-helpers.h"
#include "qemu/cutils.h"
#include "hw/intc/intc.h"
#include "qemu/log.h"
@@ -92,7 +93,12 @@ static int hmp_info_pic_foreach(Object *obj, void *opaque)
intc = INTERRUPT_STATS_PROVIDER(obj);
k = INTERRUPT_STATS_PROVIDER_GET_CLASS(obj);
if (k->print_info) {
- k->print_info(intc, mon);
+ g_autoptr(GString) buf = g_string_new("");
+ g_autoptr(HumanReadableText) info = NULL;
+
+ k->print_info(intc, buf);
+ info = human_readable_text_from_str(buf);
+ monitor_puts(mon, info->human_readable_text);
} else {
monitor_printf(mon, "Interrupt controller information not available for %s.\n",
object_get_typename(obj));