From patchwork Fri Sep 12 13:58:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 388666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 979D61401AC for ; Sat, 13 Sep 2014 00:05:23 +1000 (EST) Received: from localhost ([::1]:45230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSRTV-00082y-Jt for incoming@patchwork.ozlabs.org; Fri, 12 Sep 2014 10:05:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSROC-0006W9-8L for qemu-devel@nongnu.org; Fri, 12 Sep 2014 09:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSRO6-00011B-Jl for qemu-devel@nongnu.org; Fri, 12 Sep 2014 09:59:52 -0400 Received: from mail-qg0-x22a.google.com ([2607:f8b0:400d:c04::22a]:61026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSRO6-000110-GH for qemu-devel@nongnu.org; Fri, 12 Sep 2014 09:59:46 -0400 Received: by mail-qg0-f42.google.com with SMTP id q107so771344qgd.1 for ; Fri, 12 Sep 2014 06:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xgc5UsaQyIMTGOLlPMgNMAO3Up/VjzwmfiRgZWeYCrs=; b=WrE6S0obg5n0QVw90AQAFoZG/07QPmivxauBy9O/961VLxCQ35z0IhfEMLCD0kd+dC 0A3dn2rT37FlovLGNUsNgqg51ubKGbRkm65S3M91OVdpMDqcRkSHmy5MPQOnxc8x+7mN WnqXA2re76jJOozZUH+dnaHSTO559eHbTtFvnAfjcahI9ysWm1fFo5Pm6PU1PB3MWSLh NFmAWCusqSzshuD5zZo0zvSvwTsbjT09HSMPrGwZTISKPj3e1o9Ibi7S9/XothY4D0C3 jsQyPbWvIxzk97VvnC7yam0MMqXr332NMKdQL0VAKI+nzx0MRQr697RjAEPGB2COC4bq udjw== X-Received: by 10.140.93.230 with SMTP id d93mr12512019qge.53.1410530385061; Fri, 12 Sep 2014 06:59:45 -0700 (PDT) Received: from yakj.usersys.redhat.com (net-37-116-212-135.cust.vodafonedsl.it. [37.116.212.135]) by mx.google.com with ESMTPSA id d3sm3026565qar.42.2014.09.12.06.59.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Sep 2014 06:59:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 12 Sep 2014 15:58:56 +0200 Message-Id: <1410530338-17615-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410530338-17615-1-git-send-email-pbonzini@redhat.com> References: <1410530338-17615-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::22a Cc: Pavel Dovgalyuk Subject: [Qemu-devel] [PULL 19/21] mc146818rtc: add missed field to vmstate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Pavel Dovgalyuk This patch adds irq_reinject_on_ack_count field to VMState to allow correct saving/loading the state of MC146818 RTC. Signed-off-by: Pavel Dovgalyuk Acked-by: Juan Quintela Signed-off-by: Paolo Bonzini --- hw/timer/mc146818rtc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 17912b8..f18d128 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -733,6 +733,22 @@ static int rtc_post_load(void *opaque, int version_id) return 0; } +static const VMStateDescription vmstate_rtc_irq_reinject_on_ack_count = { + .name = "irq_reinject_on_ack_count", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_UINT16(irq_reinject_on_ack_count, RTCState), + VMSTATE_END_OF_LIST() + } +}; + +static bool rtc_irq_reinject_on_ack_count_needed(void *opaque) +{ + RTCState *s = (RTCState *)opaque; + return s->irq_reinject_on_ack_count != 0; +} + static const VMStateDescription vmstate_rtc = { .name = "mc146818rtc", .version_id = 3, @@ -753,6 +769,14 @@ static const VMStateDescription vmstate_rtc = { VMSTATE_TIMER_V(update_timer, RTCState, 3), VMSTATE_UINT64_V(next_alarm_time, RTCState, 3), VMSTATE_END_OF_LIST() + }, + .subsections = (VMStateSubsection[]) { + { + .vmsd = &vmstate_rtc_irq_reinject_on_ack_count, + .needed = rtc_irq_reinject_on_ack_count_needed, + }, { + /* empty */ + } } };