kvm-i8259: support "info pic" and "info irq"
commite267d16496e3998f271767a80ff9b0cc43be8a35
authorPeter Xu <peterx@redhat.com>
Sun, 10 Dec 2017 06:38:18 +0000 (10 14:38 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Dec 2017 08:30:32 +0000 (21 09:30 +0100)
tree08c09262036a49cf2f499be62bbf24065056f338
parent1b23190aba72a974c9a08496bf6d45e14b60087a
kvm-i8259: support "info pic" and "info irq"

Let's leverage the i8259 common code for kvm-i8259 too.

I think it's still possible that stats can lost when i8259 is in kernel
and meanwhile when irqfd is used, e.g., by vfio or vhost devices.
However that should be rare IMHO since they should be using MSIs mostly
if they really want performance (that's why people use vhost and device
assignment), and no old INTx should be used.  As long as the INTx users
are emulated in QEMU the stats will be correct.

For "info pic", it should be always accurate since we fetch kvm regs
before dump.

More importantly, it's just too simple to do this now - it's only 10+
LOC to gain this feature.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171210063819.14892-5-peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/kvm/i8259.c
hw/intc/i8259_common.c