From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPyKK-0005aF-5Z for qemu-devel@nongnu.org; Sun, 31 Jan 2016 15:10:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPyKF-000071-5A for qemu-devel@nongnu.org; Sun, 31 Jan 2016 15:10:28 -0500 References: <1454267976-27242-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1454267976-27242-4-git-send-email-mark.cave-ayland@ilande.co.uk> From: Mark Cave-Ayland Message-ID: <56AE6A20.1030809@ilande.co.uk> Date: Sun, 31 Jan 2016 20:10:08 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] ppc: include timebase in migration stream for g3beige/mac99 machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Alexey Kardashevskiy , Alexander Graf , "qemu-ppc@nongnu.org" , QEMU Developers , David Gibson On 31/01/16 19:58, Peter Maydell wrote: > On 31 January 2016 at 19:19, Mark Cave-Ayland > wrote: >> Signed-off-by: Mark Cave-Ayland >> --- >> hw/ppc/mac_newworld.c | 4 ++++ >> hw/ppc/mac_oldworld.c | 4 ++++ >> 2 files changed, 8 insertions(+) >> >> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c >> index f95086b..3283f1d 100644 >> --- a/hw/ppc/mac_newworld.c >> +++ b/hw/ppc/mac_newworld.c >> @@ -179,6 +179,7 @@ static void ppc_core99_init(MachineState *machine) >> int *token = g_new(int, 1); >> hwaddr nvram_addr = 0xFFF04000; >> uint64_t tbfreq; >> + PPCTimebase *tb; >> >> linux_boot = (kernel_filename != NULL); >> >> @@ -201,6 +202,9 @@ static void ppc_core99_init(MachineState *machine) >> /* Set time-base frequency to 100 Mhz */ >> cpu_ppc_tb_init(env, TBFREQ); >> qemu_register_reset(ppc_core99_reset, cpu); >> + >> + tb = g_malloc0(sizeof(PPCTimebase)); >> + vmstate_register(NULL, -1, &vmstate_ppc_timebase, tb); > > Is there no way to avoid the vmstate_register here (ie to > tie the migration data to an actual device or CPU object) ? Not exactly that I know of - although I shamelessly borrowed this part from similar code in spapr which has this comment: /* FIXME: Should register things through the MachineState's qdev * interface, this is a legacy from the sPAPREnvironment structure * which predated MachineState but had a similar function */ Is this something that is now possible? ATB, Mark.