From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRHkB-0001Ng-Ki for qemu-devel@nongnu.org; Sat, 22 Mar 2014 04:57:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRHk6-0001Qd-Ed for qemu-devel@nongnu.org; Sat, 22 Mar 2014 04:57:31 -0400 Received: from mail-ee0-x230.google.com ([2a00:1450:4013:c00::230]:64743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRHk6-0001QR-6E for qemu-devel@nongnu.org; Sat, 22 Mar 2014 04:57:26 -0400 Received: by mail-ee0-f48.google.com with SMTP id b57so2566020eek.35 for ; Sat, 22 Mar 2014 01:57:24 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <532D5070.5050807@redhat.com> Date: Sat, 22 Mar 2014 09:57:20 +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> In-Reply-To: <1395429454-24690-3-git-send-email-fred.konrad@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: fred.konrad@greensocs.com, qemu-devel@nongnu.org Cc: mark.burton@greensocs.com Il 21/03/2014 20:17, fred.konrad@greensocs.com ha scritto: > From: KONRAD Frederic > > This fixes a bug where qemu_icount and qemu_icount_bias are not migrated. > > Signed-off-by: KONRAD Frederic > --- > cpus.c | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/cpus.c b/cpus.c > index 687717f..bdbc431 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -440,12 +440,33 @@ static const VMStateDescription vmstate_timers = { > } > }; > > +/* > + * This is used instead of vmstate_timers when icount is used. > + * cpu_ticks_offset and dummy fields are unused in icount mode so we can replace > + * them with icount variables. > + */ > +static const VMStateDescription icount_vmstate_timers = { > + .name = "timer", > + .version_id = 2, > + .minimum_version_id = 1, > + .minimum_version_id_old = 1, > + .fields = (VMStateField[]) { > + VMSTATE_INT64(qemu_icount_bias, TimersState), > + VMSTATE_INT64(qemu_icount, TimersState), > + VMSTATE_INT64_V(cpu_clock_offset, TimersState, 2), > + VMSTATE_END_OF_LIST() > + } > +}; > + > void configure_icount(const char *option) > { > seqlock_init(&timers_state.vm_clock_seqlock, NULL); > - vmstate_register(NULL, 0, &vmstate_timers, &timers_state); > + > if (!option) { > + vmstate_register(NULL, 0, &vmstate_timers, &timers_state); > return; > + } else { > + vmstate_register(NULL, 0, &icount_vmstate_timers, &timers_state); > } > > icount_warp_timer = timer_new_ns(QEMU_CLOCK_REALTIME, > You can also use a subsection for this. Paolo