From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ru0X8-0000Cu-Qe for qemu-devel@nongnu.org; Sun, 05 Feb 2012 06:45:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ru0X5-0006Q0-7E for qemu-devel@nongnu.org; Sun, 05 Feb 2012 06:45:26 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:50055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ru0X5-0006Pw-2Q for qemu-devel@nongnu.org; Sun, 05 Feb 2012 06:45:23 -0500 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate01.web.de (Postfix) with ESMTP id 0E7351A9E212A for ; Sun, 5 Feb 2012 12:45:22 +0100 (CET) Message-ID: <4F2E6BD0.8000908@web.de> Date: Sun, 05 Feb 2012 12:45:20 +0100 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH uq/master] apic: Fix legacy vmstate loading for KVM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity , Marcelo Tosatti Cc: Paolo Bonzini , qemu-devel , kvm From: Jan Kiszka 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 Signed-off-by: Jan Kiszka --- hw/apic_common.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/hw/apic_common.c b/hw/apic_common.c index 26991b4..8373d79 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; } -- 1.7.3.4