From: Peter Maydell <peter.maydell@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] Re: [PATCH v2 1/2] hw/arm_sysctl.c: Add the Versatile Express system registers
Date: Tue, 22 Mar 2011 19:05:19 +0000 [thread overview]
Message-ID: <AANLkTimZN+MAD5HHHx2EBOML8H5ZdUstPbDqqTUXRARh@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikLnf3Aj6mP20PM90=tdxFV=T69tB7_fT12dPo6@mail.gmail.com>
On 5 March 2011 16:50, Peter Maydell <peter.maydell@linaro.org> wrote:
> I've appended a draft of a suggested extra section for
> docs/migration.txt so you can tell me if I've misunderstood
> it all :-)
Ping? In particular if somebody can fill in the [XXX] bit for
me (and correct any other mistakes!) I'll submit this as a proper
patch to the docs.
> ---begin---
> === Adding state fields to a device ===
>
> If you make a bugfix or enhancement to a device which requires the
> addition of extra state, you need to add these new state fields
> to the VMStateDescription so that:
> (1) they are saved and loaded correctly
> (2) migration between the new and old versions either works
> or fails cleanly.
>
> If the change is such that migration between versions would not
> work anyway, you can just add the new fields using the usual
> VMSTATE_* macros, increment the version_id and set the
> minimum_version_id to be the same as the version_id.
>
> Migration from the old version to the new version can be supported
> if it is OK for the new fields to remain in their default state
> [XXX is this right? are they zeroed, or do they get the value
> the device's reset function sets them to, or something else?]
> when the state of an old-version snapshot is loaded. To implement
> this you need to use the VMSTATE_*_V macros which let you specify
> the version in which a field was introduced, for instance:
>
> VMSTATE_UINT32_V(sys_cfgdata, arm_sysctl_state, 2)
>
> for a field introduced in version 2. You should also increment
> the version_id, but leave the minimum_version_id unchanged.
> Newly added VMSTATE_*_V fields should go at the end of the
> VMState description.
>
> ---endit---
thanks
-- PMM
next prev parent reply other threads:[~2011-03-22 19:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-04 20:34 [Qemu-devel] [PATCH v2 0/2] ARM: Add Versatile Express board model Peter Maydell
2011-03-04 20:34 ` [Qemu-devel] [PATCH v2 1/2] hw/arm_sysctl.c: Add the Versatile Express system registers Peter Maydell
2011-03-05 12:11 ` [Qemu-devel] " Paolo Bonzini
2011-03-05 12:34 ` Peter Maydell
2011-03-05 14:59 ` Paolo Bonzini
2011-03-05 16:50 ` Peter Maydell
2011-03-05 17:04 ` Paolo Bonzini
2011-03-07 11:45 ` Peter Maydell
2011-03-07 12:09 ` Jan Kiszka
2011-03-22 19:05 ` Peter Maydell [this message]
2011-03-22 19:53 ` Juan Quintela
2011-03-22 20:32 ` Peter Maydell
2011-03-23 8:54 ` Paolo Bonzini
2011-03-23 9:44 ` Juan Quintela
2011-03-04 20:34 ` [Qemu-devel] [PATCH v2 2/2] hw/vexpress.c: Add model of ARM Versatile Express board Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimZN+MAD5HHHx2EBOML8H5ZdUstPbDqqTUXRARh@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).