From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMCmH-0004Dh-Iz for qemu-devel@nongnu.org; Tue, 26 Aug 2014 05:11:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMCm9-0004xB-KR for qemu-devel@nongnu.org; Tue, 26 Aug 2014 05:10:57 -0400 Received: from mail-qg0-x235.google.com ([2607:f8b0:400d:c04::235]:49539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMCm9-0004wu-BB for qemu-devel@nongnu.org; Tue, 26 Aug 2014 05:10:49 -0400 Received: by mail-qg0-f53.google.com with SMTP id z60so10702775qgd.26 for ; Tue, 26 Aug 2014 02:10:49 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53FC4F14.60802@redhat.com> Date: Tue, 26 Aug 2014 11:10:44 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140826071427.1672.48119.stgit@PASHA-ISP> <20140826071452.1672.69296.stgit@PASHA-ISP> In-Reply-To: <20140826071452.1672.69296.stgit@PASHA-ISP> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/12] parallel: adding vmstate for save/restore List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: zealot351@gmail.com, maria.klimushenkova@ispras.ru Il 26/08/2014 09:14, Pavel Dovgalyuk ha scritto: > VMState added by this patch preserves correct > loading of the parallel port controller state. > > Signed-off-by: Pavel Dovgalyuk > --- > hw/char/parallel.c | 20 ++++++++++++++++++++ > 1 files changed, 20 insertions(+), 0 deletions(-) > > diff --git a/hw/char/parallel.c b/hw/char/parallel.c > index 7ac90a5..26c03d7 100644 > --- a/hw/char/parallel.c > +++ b/hw/char/parallel.c > @@ -477,6 +477,24 @@ static const MemoryRegionPortio isa_parallel_portio_sw_list[] = { > PORTIO_END_OF_LIST(), > }; > > + > +static const VMStateDescription vmstate_parallel_isa = { > + .name = "parallel_isa", > + .version_id = 1, > + .minimum_version_id = 1, > + .minimum_version_id_old = 1, > + .fields = (VMStateField[]) { > + VMSTATE_UINT8(state.dataw, ISAParallelState), > + VMSTATE_UINT8(state.datar, ISAParallelState), > + VMSTATE_UINT8(state.status, ISAParallelState), > + VMSTATE_UINT8(state.control, ISAParallelState), > + VMSTATE_INT32(state.irq_pending, ISAParallelState), > + VMSTATE_INT32(state.epp_timeout, ISAParallelState), > + VMSTATE_END_OF_LIST() > + } > +}; > + > + > static void parallel_isa_realizefn(DeviceState *dev, Error **errp) > { > static int index; > @@ -518,6 +536,8 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp) > ? &isa_parallel_portio_hw_list[0] > : &isa_parallel_portio_sw_list[0]), > s, "parallel"); > + > + vmstate_register(NULL, -1, &vmstate_parallel_isa, isa); > } > > /* Memory mapped interface */ I think you should use dc->vmsd. Paolo