From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzm96-0000Wa-Hl for qemu-devel@nongnu.org; Wed, 25 Jun 2014 08:17:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzm91-0006Lx-3h for qemu-devel@nongnu.org; Wed, 25 Jun 2014 08:17:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzm90-0006Lo-R2 for qemu-devel@nongnu.org; Wed, 25 Jun 2014 08:17:43 -0400 From: Juan Quintela In-Reply-To: <1403684808-23248-3-git-send-email-fred.konrad@greensocs.com> (fred konrad's message of "Wed, 25 Jun 2014 10:26:37 +0200") References: <1403684808-23248-1-git-send-email-fred.konrad@greensocs.com> <1403684808-23248-3-git-send-email-fred.konrad@greensocs.com> Date: Wed, 25 Jun 2014 14:17:31 +0200 Message-ID: <87wqc5yyhw.fsf@troll.troll> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC PATCH v4 02/13] migration: migrate icount fields. Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fred.konrad@greensocs.com Cc: peter.maydell@linaro.org, mark.burton@greensocs.com, qemu-devel@nongnu.org, dgilbert@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, vilanova@ac.upc.edu fred.konrad@greensocs.com wrote: > From: KONRAD Frederic > > This fixes a bug where qemu_icount and qemu_icount_bias are not migrated. > It adds a subsection "timer/icount" to vmstate_timers so icount is migrated only > when needed. > > Signed-off-by: KONRAD Frederic > Reviewed-by: Amit Shah > --- > cpus.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/cpus.c b/cpus.c > index 127de1c..8d2ddf0 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -429,6 +429,26 @@ void qemu_clock_warp(QEMUClockType type) > } > } > > +static bool icount_state_needed(void *opaque) > +{ > + return use_icount; > +} > + > +/* > + * This is a subsection for icount migration. > + */ > +static const VMStateDescription icount_vmstate_timers = { > + .name = "timer/icount", > + .version_id = 1, > + .minimum_version_id = 1, > + .minimum_version_id_old = 1, Drop this line, not needed anymore. > + .fields = (VMStateField[]) { Remove spaces > + VMSTATE_INT64(qemu_icount_bias, TimersState), > + VMSTATE_INT64(qemu_icount, TimersState), > + VMSTATE_END_OF_LIST() > + } > +}; > + > static const VMStateDescription vmstate_timers = { > .name = "timer", > .version_id = 2, > @@ -438,6 +458,14 @@ static const VMStateDescription vmstate_timers = { > VMSTATE_INT64(dummy, TimersState), > VMSTATE_INT64_V(cpu_clock_offset, TimersState, 2), > VMSTATE_END_OF_LIST() > + }, > + .subsections = (VMStateSubsection[]) { > + { > + .vmsd = &icount_vmstate_timers, > + .needed = icount_state_needed, > + }, { > + /* empty */ > + } > } > }; Rest is ok. Thanks, Juan.