mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/intc: Introduce x-query-interrupt-controllers QMP command
This is a counterpart to the HMP "info pic" command. It is being added with an "x-" prefix because this QMP command is intended as an adhoc debugging tool and will thus not be modelled in QAPI as fully structured data, nor will it have long term guaranteed stability. The existing HMP command is rewritten to call the QMP command. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20240610063518.50680-3-philmd@linaro.org>
This commit is contained in:
parent
b2580720d0
commit
795eaa62fa
4 changed files with 47 additions and 34 deletions
|
@ -361,6 +361,35 @@ HumanReadableText *qmp_x_query_irq(Error **errp)
|
|||
return human_readable_text_from_str(buf);
|
||||
}
|
||||
|
||||
static int qmp_x_query_intc_foreach(Object *obj, void *opaque)
|
||||
{
|
||||
InterruptStatsProvider *intc;
|
||||
InterruptStatsProviderClass *k;
|
||||
GString *buf = opaque;
|
||||
|
||||
if (object_dynamic_cast(obj, TYPE_INTERRUPT_STATS_PROVIDER)) {
|
||||
intc = INTERRUPT_STATS_PROVIDER(obj);
|
||||
k = INTERRUPT_STATS_PROVIDER_GET_CLASS(obj);
|
||||
if (k->print_info) {
|
||||
k->print_info(intc, buf);
|
||||
} else {
|
||||
g_string_append_printf(buf,
|
||||
"Interrupt controller information not available for %s.\n",
|
||||
object_get_typename(obj));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
HumanReadableText *qmp_x_query_interrupt_controllers(Error **errp)
|
||||
{
|
||||
g_autoptr(GString) buf = g_string_new("");
|
||||
object_child_foreach_recursive(object_get_root(),
|
||||
qmp_x_query_intc_foreach, buf);
|
||||
return human_readable_text_from_str(buf);
|
||||
}
|
||||
|
||||
GuidInfo *qmp_query_vm_generation_id(Error **errp)
|
||||
{
|
||||
GuidInfo *info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue