All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Andrew Jeffery <andrew@aj.id.au>
Subject: Re: [Qemu-devel] [PATCH] timer/aspeed: fix vmstate version id
Date: Mon, 23 Apr 2018 10:34:21 +0100	[thread overview]
Message-ID: <CAFEAcA9XBHE5YxN27M1ugprmSf=o5iiNakO2omrY+HBgCszV5Q@mail.gmail.com> (raw)
In-Reply-To: <53691cbf-08bf-e3f7-22d3-601a279aa08a@kaod.org>

On 23 April 2018 at 10:28, Cédric Le Goater <clg@kaod.org> wrote:
> On 04/23/2018 11:12 AM, Peter Maydell wrote:
>>> diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c
>>> index 50acbf530a3a..7df19bd9df91 100644
>>> --- a/hw/timer/aspeed_timer.c
>>> +++ b/hw/timer/aspeed_timer.c
>>> @@ -498,8 +498,8 @@ static const VMStateDescription vmstate_aspeed_timer = {
>>>
>>>  static const VMStateDescription vmstate_aspeed_timer_state = {
>>>      .name = "aspeed.timerctrl",
>>> -    .version_id = 1,
>>> -    .minimum_version_id = 1,
>>> +    .version_id = 2,
>>> +    .minimum_version_id = 2,
>>>      .fields = (VMStateField[]) {
>>>          VMSTATE_UINT32(ctrl, AspeedTimerCtrlState),
>>>          VMSTATE_UINT32(ctrl2, AspeedTimerCtrlState),
>> Wouldn't it be simpler to just fix the incorrect value in
>> the VMSTATE_STRUCT_ARRAY(timers, AspeedTimerCtrlState,
>> line ?
>
> Yes. Also.
>
> Or bring back all the version ids to 1, as we never supported
> migration before.

I think it's nice to at least do the "bump version" thing, so you
get a (hopefully comprehensible) error rather than just wrong
data if you do try a cross version migration, so I would
vote for just fixing the one thing that was wrong: the
number in VMSTATE_STRUCT_ARRAY is the version to be used of
the substruct, so it didn't need to be bumped in commit
1d3e65aa7a; the main version numbers for vmstate_aspeed_timer
did need to be bumped because part of the main struct changed.

thanks
-- PMM

  reply	other threads:[~2018-04-23  9:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23  6:40 [Qemu-devel] [PATCH] timer/aspeed: fix vmstate version id Cédric Le Goater
2018-04-23  9:12 ` Peter Maydell
2018-04-23  9:28   ` Cédric Le Goater
2018-04-23  9:34     ` Peter Maydell [this message]
2018-04-23  9:55       ` Cédric Le Goater
2018-04-23 10:00       ` Cédric Le Goater
2018-04-23 10:46         ` Dr. David Alan Gilbert
2018-04-23 11:35           ` Cédric Le Goater

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='CAFEAcA9XBHE5YxN27M1ugprmSf=o5iiNakO2omrY+HBgCszV5Q@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.