From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOUx7-0006WG-94 for qemu-devel@nongnu.org; Mon, 01 Sep 2014 12:59:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOUx2-00033v-Bm for qemu-devel@nongnu.org; Mon, 01 Sep 2014 12:59:37 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:54831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOUx2-00033k-4r for qemu-devel@nongnu.org; Mon, 01 Sep 2014 12:59:32 -0400 Received: by mail-lb0-f182.google.com with SMTP id u10so6234445lbd.13 for ; Mon, 01 Sep 2014 09:59:30 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140828111930.1624.40704.stgit@PASHA-ISP> References: <20140828111822.1624.24556.stgit@PASHA-ISP> <20140828111930.1624.40704.stgit@PASHA-ISP> From: Peter Maydell Date: Mon, 1 Sep 2014 17:59:10 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2 12/12] pl031: add missed field to vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk Cc: Paolo Bonzini , zealot351@gmail.com, maria.klimushenkova@ispras.ru, QEMU Developers On 28 August 2014 12:19, Pavel Dovgalyuk wrote: > This patch adds timer which uses virtual clock to the VMState. > Such timers are required for saving because virtual clock is the part > of the virtual machine state. > > Signed-off-by: Pavel Dovgalyuk > --- > hw/timer/pl031.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/hw/timer/pl031.c b/hw/timer/pl031.c > index 34d9b44..f8e5abc 100644 > --- a/hw/timer/pl031.c > +++ b/hw/timer/pl031.c > @@ -230,12 +230,13 @@ static int pl031_post_load(void *opaque, int version_id) > > static const VMStateDescription vmstate_pl031 = { > .name = "pl031", > - .version_id = 1, > + .version_id = 2, > .minimum_version_id = 1, > .pre_save = pl031_pre_save, > .post_load = pl031_post_load, > .fields = (VMStateField[]) { > VMSTATE_UINT32(tick_offset_vmstate, PL031State), > + VMSTATE_TIMER_V(timer, PL031State, 2), > VMSTATE_UINT32(mr, PL031State), > VMSTATE_UINT32(lr, PL031State), > VMSTATE_UINT32(cr, PL031State), Looking at the code I'm not sure this patch is required. It looks like the intention is that the migrated state for the timer is in the tick_offset_vmstate: we have a pre-save hook that sets up that field, and then the post-load hook calls pl031_set_alarm() which will always completely reinitialise s->timer using timer_del() or timer_mod(). What am I missing? thanks -- PMM