summary refs log tree commit diff stats
path: root/hw/apic_common.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-02-05 12:45:20 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2012-02-08 15:57:51 -0200
commita4aecd2819fd31641ab62472e3385073043521fb (patch)
treee4812b4e215e805fdbd3828f44cd26dd4eed0bdc /hw/apic_common.c
parent3d4b26494fdce89354dac49ef909356ccda77914 (diff)
downloadfocaccia-qemu-a4aecd2819fd31641ab62472e3385073043521fb.tar.gz
focaccia-qemu-a4aecd2819fd31641ab62472e3385073043521fb.zip
apic: Fix legacy vmstate loading for KVM
Also in case of loading pre-vmstate machines, we also need to open-code
the reading of the timer expires value and instead call the post_load
callback to apply it (or not). This fixes loading of legacy states into
the KVM APIC.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw/apic_common.c')
-rw-r--r--hw/apic_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/apic_common.c b/hw/apic_common.c
index 26991b4516..8373d79c41 100644
--- a/hw/apic_common.c
+++ b/hw/apic_common.c
@@ -188,6 +188,7 @@ static void apic_reset_common(DeviceState *d)
 static int apic_load_old(QEMUFile *f, void *opaque, int version_id)
 {
     APICCommonState *s = opaque;
+    APICCommonClass *info = APIC_COMMON_GET_CLASS(s);
     int i;
 
     if (version_id > 2) {
@@ -220,7 +221,11 @@ static int apic_load_old(QEMUFile *f, void *opaque, int version_id)
     s->next_time = qemu_get_be64(f);
 
     if (version_id >= 2) {
-        qemu_get_timer(f, s->timer);
+        s->timer_expiry = qemu_get_be64(f);
+    }
+
+    if (info->post_load) {
+        info->post_load(s);
     }
     return 0;
 }