[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
signature.asc
Description: PGP signature
- [Qemu-ppc] [PATCH 0/8] ppc: more Mac-related fixups, Mark Cave-Ayland, 2017/09/17
- [Qemu-ppc] [PATCH 3/8] ppc/ide/macio: Add missing registers, Mark Cave-Ayland, 2017/09/17
- [Qemu-ppc] [PATCH 6/8] ppc: Fix OpenPIC model, Mark Cave-Ayland, 2017/09/17
- [Qemu-ppc] [PATCH 8/8] openpic: Fix problem when IRQ transitions from edge to level, Mark Cave-Ayland, 2017/09/17
- [Qemu-ppc] [PATCH 5/8] ppc/mac: More rework of the DBDMA emulation, Mark Cave-Ayland, 2017/09/17