From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRLX3-00030o-60 for qemu-devel@nongnu.org; Tue, 09 Sep 2014 09:32:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRLWy-00039O-7Z for qemu-devel@nongnu.org; Tue, 09 Sep 2014 09:32:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRLWx-00039D-Vq for qemu-devel@nongnu.org; Tue, 09 Sep 2014 09:32:24 -0400 From: Juan Quintela In-Reply-To: <1410265809-27247-7-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Tue, 9 Sep 2014 14:30:05 +0200") References: <1410265809-27247-1-git-send-email-pbonzini@redhat.com> <1410265809-27247-7-git-send-email-pbonzini@redhat.com> Date: Tue, 09 Sep 2014 15:32:19 +0200 Message-ID: <87zje82a3g.fsf@troll.troll> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 06/10] parallel: adding vmstate for save/restore Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: amit.shah@redhat.com, qemu-devel@nongnu.org, Pavel.Dovgaluk@ispras.ru, dgilbert@redhat.com Paolo Bonzini wrote: > From: Pavel Dovgalyuk > > VMState added by this patch preserves correct > loading of the parallel port controller state. > > Signed-off-by: Pavel Dovgalyuk > Signed-off-by: Paolo Bonzini This breaks migration with old machine type, but as far as I can see, parallel is only added when used, and if we are using it, we need this, right? If my understanding is correct: Acked-by: Juan Quintela > --- > hw/char/parallel.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/hw/char/parallel.c b/hw/char/parallel.c > index 7ac90a5..c2b553f 100644 > --- a/hw/char/parallel.c > +++ b/hw/char/parallel.c > @@ -477,6 +477,23 @@ 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, > + .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; > @@ -606,6 +623,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data) > DeviceClass *dc = DEVICE_CLASS(klass); > > dc->realize = parallel_isa_realizefn; > + dc->vmsd = &vmstate_parallel_isa; > dc->props = parallel_isa_properties; > set_bit(DEVICE_CATEGORY_INPUT, dc->categories); > }