qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH v4 5/9] hw/timer: QOM'ify m48txx_sysbus (pass 2)


From: Peter Maydell
Subject: Re: [Qemu-arm] [PATCH v4 5/9] hw/timer: QOM'ify m48txx_sysbus (pass 2)
Date: Mon, 22 Feb 2016 11:03:02 +0000

On 22 February 2016 at 10:28, hitmoon <address@hidden> wrote:
> 在 2016年02月22日 17:24, Peter Maydell 写道:
>> Just noticed this won't work as it is -- the vmstate
>> struct is for the M48t59State*, but the ISA and
>> Sysbus wrappers have their own structs which are
>> what the dc->vmsd will be wanting to operate on.
>> You'd need extra VMState structs I think and
>> somebody who knows migration better than me to say
>> whether that is a migration compat break.

> It seems that the old code also use the same vmstate structure. Maybe it's a
> common structure which will not be used at the same time.

The old code passes vmstate_register() a pointer to the
M48t59State, and so the offsets in the vmstate line up correctly
with the fields it wants to access. If you use dc->vmsd then the
pointer that is (implicitly) used is the pointer to the device
structure itself, which is not the same address as the
M48t59State embedded inside that struct.

You'd basically need to have extra VMState structures for the
devices themselves which just said "inside this M48txxISAState
is an M48t59State", and "inside this M48txxSysBusState is a
M48t59State" and referred to the existing vmstate for the
M48t59State.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]