From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRL0P-00045I-G7 for qemu-devel@nongnu.org; Tue, 09 Sep 2014 08:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRL0K-0005Mi-IH for qemu-devel@nongnu.org; Tue, 09 Sep 2014 08:58:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRL0K-0005MQ-Bc for qemu-devel@nongnu.org; Tue, 09 Sep 2014 08:58:40 -0400 From: Juan Quintela In-Reply-To: <1410265809-27247-11-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Tue, 9 Sep 2014 14:30:09 +0200") References: <1410265809-27247-1-git-send-email-pbonzini@redhat.com> <1410265809-27247-11-git-send-email-pbonzini@redhat.com> Date: Tue, 09 Sep 2014 14:58:33 +0200 Message-ID: <87wq9d2bnq.fsf@troll.troll> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 10/10] mc146818rtc: add missed field to vmstate Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: amit.shah@redhat.com, qemu-devel@nongnu.org, Pavel.Dovgaluk@ispras.ru, dgilbert@redhat.com Paolo Bonzini wrote: > 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 > Signed-off-by: Paolo Bonzini Acked-by: Juan Quintela > --- > hw/timer/mc146818rtc.c | 24 +++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c > index 17912b8..2c4b650 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; If you have to resend for any reason, please remove this unneeded cast. > + 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 */ > + } > } > };