From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 2/4] i8254: Open-code timer restore Date: Sun, 05 Feb 2012 12:23:51 +0100 Message-ID: <4F2E66C7.8070505@redhat.com> References: <77a9fa5aa9aae73889803315c291418a4d99505a.1328438750.git.jan.kiszka@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org To: kvm@vger.kernel.org Return-path: Received: from plane.gmane.org ([80.91.229.3]:34546 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752868Ab2BELYE (ORCPT ); Sun, 5 Feb 2012 06:24:04 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ru0CO-0007An-HW for kvm@vger.kernel.org; Sun, 05 Feb 2012 12:24:00 +0100 Received: from 193.191.36.151 ([193.191.36.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Feb 2012 12:24:00 +0100 Received: from pbonzini by 193.191.36.151 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Feb 2012 12:24:00 +0100 In-Reply-To: <77a9fa5aa9aae73889803315c291418a4d99505a.1328438750.git.jan.kiszka@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On 02/05/2012 11:46 AM, Jan Kiszka wrote: > diff --git a/hw/i8254_common.c b/hw/i8254_common.c > index 0601d88..b60fbda 100644 > --- a/hw/i8254_common.c > +++ b/hw/i8254_common.c > @@ -234,9 +234,8 @@ static int pit_load_old(QEMUFile *f, void *opaque, int version_id) > qemu_get_8s(f,&s->gate); > s->count_load_time = qemu_get_be64(f); > s->irq_disabled = 0; > - if (s->irq_timer) { > + if (i == 0) { > s->next_transition_time = qemu_get_be64(f); > - qemu_get_timer(f, s->irq_timer); > } > } > return 0; You need to invoke the post load callback manually in the load_old callback; see vmstate_load_state: if (version_id < vmsd->minimum_version_id) { return vmsd->load_state_old(f, opaque, version_id); } I noticed that in apic_common's apic_load_old you don't have the bug, but on the other hand you're unconditionally loading into s->timer, so "old" migration to a destination with in-kernel APIC doesn't work: if (version_id >= 2) { qemu_get_timer(f, s->timer); } Paolo