From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS71V-0005KS-8h for qemu-devel@nongnu.org; Mon, 24 Mar 2014 11:42:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS71M-00044P-Sf for qemu-devel@nongnu.org; Mon, 24 Mar 2014 11:42:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS71M-000446-Ii for qemu-devel@nongnu.org; Mon, 24 Mar 2014 11:42:40 -0400 Message-ID: <53305267.9070308@redhat.com> Date: Mon, 24 Mar 2014 16:42:31 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1395429454-24690-1-git-send-email-fred.konrad@greensocs.com> <1395429454-24690-3-git-send-email-fred.konrad@greensocs.com> <532D5070.5050807@redhat.com> <5330460F.8020807@greensocs.com> In-Reply-To: <5330460F.8020807@greensocs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 02/12] migration: migrate icount fields. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frederic Konrad , qemu-devel@nongnu.org Cc: mark.burton@greensocs.com Il 24/03/2014 15:49, Frederic Konrad ha scritto: > --- a/cpus.c > +++ b/cpus.c > @@ -427,6 +427,26 @@ void qemu_clock_warp(QEMUClockType type) > } > } > > +static bool icount_state_needed(void *opaque) > +{ > + return (use_icount != 0); > +} > + > +/* > + * This is a subsection for icount migration. > + */ > +static const VMStateDescription icount_vmstate_timers = { > + .name = "icount", > + .version_id = 2, 1 here. > + .minimum_version_id = 1, > + .minimum_version_id_old = 1, > + .fields = (VMStateField[]) { > + 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, > @@ -437,6 +457,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 */ > + } > } > }; > > Thanks, > Fred Yes, quite exactly that part from the version_id. If you can test it, this patch would be good for 2.0 too. Paolo