hmp: fix qemu crash due to ioapic state dump w/ split irqchip
authorWanpeng Li <wanpeng.li@hotmail.com>
Fri, 23 Sep 2016 03:47:36 +0000 (11:47 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 4 Oct 2016 16:16:15 +0000 (17:16 +0100)
The qemu will crash when info ioapic through hmp if irqchip
is split. Below message is splat:

KVM_GET_IRQCHIP failed: Unknown error -6

This patch fix it by dumping the ioapic state from the qemu
emulated ioapic if irqchip is split.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Message-Id: <1474602456-3232-1-git-send-email-wanpeng.li@hotmail.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-ID: <20160923090824.GF15411@pxdev.xzpeter.org>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
target-i386/monitor.c

index fccfe40ab7b3d6523de4d190cc3828e716af501a..9a3b4d746e8d4b1a561300e2d3cb1889c5f5dbe3 100644 (file)
@@ -504,7 +504,8 @@ void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
 
 void hmp_info_io_apic(Monitor *mon, const QDict *qdict)
 {
-    if (kvm_irqchip_in_kernel()) {
+    if (kvm_irqchip_in_kernel() &&
+        !kvm_irqchip_is_split()) {
         kvm_ioapic_dump_state(mon, qdict);
     } else {
         ioapic_dump_state(mon, qdict);