aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-02-03 15:18:16 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-02-16 14:06:55 +0100
commitc6fcb0e201ad296a9c0f587486830d9508094efb (patch)
tree02d88091fccc90e2d45b15d8c747de30d6b5f22f
parent5dae13cd71f0755a1395b5a4cde635b8a6ee3f58 (diff)
kvm/ioapic: dump real object instead of a fake one
When we do "info ioapic" for kvm ioapic, we were building up a temporary ioapic object. Let's fetch the real one and update correspond to the real object as well. This fixes printing uninitialized version field in ioapic_print_redtbl(). Reported-by: Peter Maydell <peter.maydell@linaro.org> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1486106298-3699-2-git-send-email-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/i386/kvm/ioapic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index 8eb2c7a70f..716d59aa22 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -114,11 +114,11 @@ static void kvm_ioapic_put(IOAPICCommonState *s)
void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict)
{
- IOAPICCommonState s;
+ IOAPICCommonState *s = IOAPIC_COMMON(object_resolve_path("ioapic", NULL));
- kvm_ioapic_get(&s);
-
- ioapic_print_redtbl(mon, &s);
+ assert(s);
+ kvm_ioapic_get(s);
+ ioapic_print_redtbl(mon, s);
}
static void kvm_ioapic_reset(DeviceState *dev)