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>
This commit is contained in:
Philippe Mathieu-Daudé 2024-06-07 12:47:04 +02:00
parent a58e653aa2
commit b2580720d0
9 changed files with 57 additions and 68 deletions

View file

@ -31,7 +31,6 @@
#include "qapi/error.h"
#include "qapi/qapi-events-machine.h"
#include "qapi/qapi-events-qdev.h"
#include "qapi/type-helpers.h"
#include "qapi/visitor.h"
#include "sysemu/sysemu.h"
#include "sysemu/hostmem.h"
@ -90,8 +89,6 @@
#include "hw/ppc/spapr_nvdimm.h"
#include "hw/ppc/spapr_numa.h"
#include "monitor/monitor.h"
#include <libfdt.h>
/* SLOF memory layout:
@ -4527,18 +4524,13 @@ static ICPState *spapr_icp_get(XICSFabric *xi, int vcpu_id)
return cpu ? spapr_cpu_state(cpu)->icp : NULL;
}
static void spapr_pic_print_info(InterruptStatsProvider *obj,
Monitor *mon)
static void spapr_pic_print_info(InterruptStatsProvider *obj, GString *buf)
{
SpaprMachineState *spapr = SPAPR_MACHINE(obj);
g_autoptr(GString) buf = g_string_new("");
g_autoptr(HumanReadableText) info = NULL;
spapr_irq_print_info(spapr, buf);
g_string_append_printf(buf, "irqchip: %s\n",
kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
info = human_readable_text_from_str(buf);
monitor_puts(mon, info->human_readable_text);
}
/*