[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 3/3] ppc: include timebase in migrati
From: |
Mark Cave-Ayland |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 3/3] ppc: include timebase in migration stream for g3beige/mac99 machines |
Date: |
Sun, 31 Jan 2016 20:10:08 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 |
On 31/01/16 19:58, Peter Maydell wrote:
> On 31 January 2016 at 19:19, Mark Cave-Ayland
> <address@hidden> wrote:
>> Signed-off-by: Mark Cave-Ayland <address@hidden>
>> ---
>> 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.