qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 04/12] parallel: adding vmstate for save/restore


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 04/12] parallel: adding vmstate for save/restore
Date: Tue, 26 Aug 2014 11:10:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

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 <address@hidden>
> ---
>  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




reply via email to

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