qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v2 04/49] fdc: adding vmstate for save/resto


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH v2 04/49] fdc: adding vmstate for save/restore
Date: Mon, 28 Jul 2014 11:47:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Il 17/07/2014 13:02, Pavel Dovgalyuk ha scritto:
> VMState added by this patch preserves correct
> loading of the FDC device state.
> 
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> ---
>  hw/block/fdc.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index 490d127..132310a 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -697,12 +697,17 @@ static const VMStateDescription 
> vmstate_fdrive_media_rate = {
>  
>  static const VMStateDescription vmstate_fdrive = {
>      .name = "fdrive",
> -    .version_id = 1,
> +    .version_id = 2,
>      .minimum_version_id = 1,
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT8(head, FDrive),
>          VMSTATE_UINT8(track, FDrive),
>          VMSTATE_UINT8(sect, FDrive),
> +        VMSTATE_UINT8_V(last_sect, FDrive, 2),
> +        VMSTATE_UINT8_V(max_track, FDrive, 2),
> +        VMSTATE_UINT16_V(bps, FDrive, 2),
> +        VMSTATE_UINT8_V(ro, FDrive, 2),
> +        VMSTATE_UINT8_V(perpendicular, FDrive, 2),

Perpendicular can be added to a subsection, migrated only if nonzero.
The others can be reconstructed by calling fd_revalidate in
vmstate_fdrive's post_load callback.


>          VMSTATE_END_OF_LIST()
>      },
>      .subsections = (VMStateSubsection[]) {
> @@ -736,7 +741,7 @@ static int fdc_post_load(void *opaque, int version_id)
>  
>  static const VMStateDescription vmstate_fdc = {
>      .name = "fdc",
> -    .version_id = 2,
> +    .version_id = 3,
>      .minimum_version_id = 2,
>      .pre_save = fdc_pre_save,
>      .post_load = fdc_post_load,
> @@ -769,6 +774,8 @@ static const VMStateDescription vmstate_fdc = {
>          VMSTATE_UINT8_EQUAL(num_floppies, FDCtrl),
>          VMSTATE_STRUCT_ARRAY(drives, FDCtrl, MAX_FD, 1,
>                               vmstate_fdrive, FDrive),
> +        VMSTATE_INT32_V(reset_sensei, FDCtrl, 3),

Subsection, only migrated if nonzero.

> +        VMSTATE_TIMER_V(result_timer, FDCtrl, 3),

Subsection, only migrated if pending.

Paolo

>          VMSTATE_END_OF_LIST()
>      }
>  };
> 
> 
> 




reply via email to

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