On 19 June 2015 at 15:48, Denis V. Lunev <d...@openvz.org> wrote: > From: Pavel Butsykin <pbutsy...@virtuozzo.com> > > Added the hmp command to query io apic state, may be usefull after guest > crashes to understand IRQ routing in guest. > > Implementation is only for kvm here. The dump will look like > (qemu) info apic-io > ioapic ID=00 IRR=00000000 SEL=18 > ioapic 00 00000000000100ff: int=ff delmod=0:Fixed P.H.EM dest=0 > ioapic 01 0300000000000993: int=93 delmod=1:LowPri L.H.E. dest=3 > ... > ioapic 23 00000000000100ff: int=ff delmod=0:Fixed P.H.EM dest=0 > --- a/monitor.c > +++ b/monitor.c > @@ -957,6 +957,19 @@ int monitor_get_cpu_index(void) > return cpu->cpu_index; > } > > +#if defined(TARGET_I386) > +static void hmp_info_apic_io(Monitor *mon, const QDict *qdict) > +{ > + if (kvm_irqchip_in_kernel()) { > + kvm_ioapic_dump_state(mon, qdict); > + } > +} > +#else > +static void hmp_info_apic_io(Monitor *mon, const QDict *qdict) > +{ > +} > +#endif > + > static void hmp_info_apic_local(Monitor *mon, const QDict *qdict) > { > CPUState *cpu; > @@ -2588,6 +2601,13 @@ static mon_cmd_t info_cmds[] = { > .mhandler.cmd = hmp_info_apic_local, > }, > { > + .name = "apic-io", > + .args_type = "", > + .params = "", > + .help = "show io apic state", > + .mhandler.cmd = hmp_info_apic_io, > + }
Can we please not add more target- and device-specific code to monitor.c? We need a sensible abstraction layer that allows devices and CPUs to register monitor commands without filling monitor.c up with random ifdeffery. thanks -- PMM