From patchwork Fri Apr 8 15:20:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Obergfell X-Patchwork-Id: 694941 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p38FLAHI009799 for ; Fri, 8 Apr 2011 15:21:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932226Ab1DHPVG (ORCPT ); Fri, 8 Apr 2011 11:21:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38578 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932195Ab1DHPVE (ORCPT ); Fri, 8 Apr 2011 11:21:04 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p38FKpxY002036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Apr 2011 11:20:51 -0400 Received: from localhost.localdomain (vpn1-4-212.ams2.redhat.com [10.36.4.212]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p38FKgc3018813; Fri, 8 Apr 2011 11:20:49 -0400 From: Ulrich Obergfell To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, uobergfe@redhat.com, gcosta@redhat.com, avi@redhat.com, aliguori@us.ibm.com, jan.kiszka@siemens.com Subject: [PATCH v2 3/5] hpet 'driftfix': add fields to HPETTimer and VMStateDescription Date: Fri, 8 Apr 2011 17:20:40 +0200 Message-Id: <1302276042-3497-4-git-send-email-uobergfe@redhat.com> In-Reply-To: <1302276042-3497-1-git-send-email-uobergfe@redhat.com> References: <1302276042-3497-1-git-send-email-uobergfe@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 08 Apr 2011 15:21:10 +0000 (UTC) Signed-off-by: Ulrich Obergfell --- hw/hpet.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/hpet.c b/hw/hpet.c index 45847ed..c150da5 100644 --- a/hw/hpet.c +++ b/hw/hpet.c @@ -55,6 +55,11 @@ typedef struct HPETTimer { /* timers */ uint8_t wrap_flag; /* timer pop will indicate wrap for one-shot 32-bit * mode. Next pop will be actual timer expiration. */ + uint64_t saved_period; + uint64_t ticks_not_accounted; + uint32_t irqs_to_inject; + uint32_t irq_rate; + uint32_t divisor; } HPETTimer; typedef struct HPETState { @@ -248,7 +253,7 @@ static int hpet_post_load(void *opaque, int version_id) static const VMStateDescription vmstate_hpet_timer = { .name = "hpet_timer", - .version_id = 1, + .version_id = 3, .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField []) { @@ -258,6 +263,11 @@ static const VMStateDescription vmstate_hpet_timer = { VMSTATE_UINT64(fsb, HPETTimer), VMSTATE_UINT64(period, HPETTimer), VMSTATE_UINT8(wrap_flag, HPETTimer), + VMSTATE_UINT64_V(saved_period, HPETTimer, 3), + VMSTATE_UINT64_V(ticks_not_accounted, HPETTimer, 3), + VMSTATE_UINT32_V(irqs_to_inject, HPETTimer, 3), + VMSTATE_UINT32_V(irq_rate, HPETTimer, 3), + VMSTATE_UINT32_V(divisor, HPETTimer, 3), VMSTATE_TIMER(qemu_timer, HPETTimer), VMSTATE_END_OF_LIST() } @@ -265,7 +275,7 @@ static const VMStateDescription vmstate_hpet_timer = { static const VMStateDescription vmstate_hpet = { .name = "hpet", - .version_id = 2, + .version_id = 3, .minimum_version_id = 1, .minimum_version_id_old = 1, .pre_save = hpet_pre_save,