qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH 7/8] openpic: add missing timer fields to vmstate_


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH 7/8] openpic: add missing timer fields to vmstate_openpic_timer
Date: Tue, 19 Sep 2017 08:44:23 +1000
User-agent: Mutt/1.8.3 (2017-05-23)

On Sun, Sep 17, 2017 at 06:15:47PM +0100, Mark Cave-Ayland wrote:
> Observation of the code shows indicates that several timer fields are
> missing from the migration stream.

So, adding new things to the migration stream always requires some
thought.  The commit message should contain a rationale for why the
proposed representation is a good one.  In particular is it one that's
unlikely to be difficult if the device changes internal details in
future.  When possible it's best to stick to architected documented
state of the modelled hardware, though I can see you're probably going
to need some extras in this case.

> 
> Signed-off-by: Mark Cave-Ayland <address@hidden>
> ---
>  hw/intc/openpic.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c
> index 10d6e87..debfcbf 100644
> --- a/hw/intc/openpic.c
> +++ b/hw/intc/openpic.c
> @@ -1570,11 +1570,14 @@ static const VMStateDescription 
> vmstate_openpic_irqsource = {
>  
>  static const VMStateDescription vmstate_openpic_timer = {
>      .name = "openpic_timer",
> -    .version_id = 0,
> -    .minimum_version_id = 0,
> +    .version_id = 1,
> +    .minimum_version_id = 1,
>      .fields = (VMStateField[]) {
>          VMSTATE_UINT32(tccr, OpenPICTimer),
>          VMSTATE_UINT32(tbcr, OpenPICTimer),
> +        VMSTATE_BOOL(qemu_timer_active, OpenPICTimer),
> +        VMSTATE_TIMER_PTR(qemu_timer, OpenPICTimer),
> +        VMSTATE_UINT64(origin_time, OpenPICTimer),
>          VMSTATE_END_OF_LIST()
>      }
>  };
> @@ -1620,7 +1623,7 @@ static const VMStateDescription vmstate_openpic = {
>          VMSTATE_UINT32_EQUAL(nb_cpus, OpenPICState, NULL),
>          VMSTATE_STRUCT_VARRAY_UINT32(dst, OpenPICState, nb_cpus, 0,
>                                       vmstate_openpic_irqdest, IRQDest),
> -        VMSTATE_STRUCT_ARRAY(timers, OpenPICState, OPENPIC_MAX_TMR, 0,
> +        VMSTATE_STRUCT_ARRAY(timers, OpenPICState, OPENPIC_MAX_TMR, 1,
>                               vmstate_openpic_timer, OpenPICTimer),
>          VMSTATE_STRUCT_ARRAY(msi, OpenPICState, MAX_MSI, 0,
>                               vmstate_openpic_msi, OpenPICMSI),

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

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