On 23 February 2016 at 05:11, hitmoon <zxq_yx_...@163.com> wrote: > > 在 2016年02月22日 19:03, Peter Maydell 写道: >> 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.
> I add a new structure for m48t59_isa as follows: > > static const VMStateDescription vmstate_m48t59_isa = { > .name = "m48t59-isa", > .version_id = 1, > .minimum_version_id = 1, > .fields = (VMStateField[]) { > VMSTATE_UINT8(state.lock, M48txxISAState), > VMSTATE_UINT16(state.addr, M48txxISAState), > VMSTATE_VBUFFER_UINT32(state.buffer, M48txxISAState, 0, NULL, 0, > state.size), > VMSTATE_END_OF_LIST() > } > }; > > is this correct? No. I said you needed to have a vmstate struct that said "inside this M48txxISAState is a M48t59State", and your suggested struct is not doing that. thanks -- PMM