All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Andrew Baumann <Andrew.Baumann@microsoft.com>
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>,
	Peter Crosthwaite <crosthwaitepeter@gmail.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] hw/sd: model a power-up delay, as a workaround for an EDK2 bug
Date: Mon, 25 Jan 2016 18:33:21 +0000	[thread overview]
Message-ID: <CAFEAcA9wrEjCnskcnaq35+ojurbrq-c5CM4LZznht1gCiTTn5Q@mail.gmail.com> (raw)
In-Reply-To: <BLUPR0301MB20343516D6813ECE6F6D67E99EE60@BLUPR0301MB2034.namprd03.prod.outlook.com>

On 23 December 2015 at 19:37, Andrew Baumann
<Andrew.Baumann@microsoft.com> wrote:
>> From: Peter Maydell [mailto:peter.maydell@linaro.org]
>> If we care about migration compatibility I think the recommendation
>   ^^^^^^^^^^
>> is to use subsections, rather than marking fields as only existing
>> in particular versions. (see docs/migration.txt for a discussion
>> of subsections).
>
> Do we care about migration compatibility for this code?

This is a good question. The answer might well be 'no', but it's
pretty hard to tell because the SD card model is used by a lot of
machines. (For devices that are board-specific it's much easier to say.)
I think that getting migration compatibility right is probably the better
approach; it's not that much harder.

So we should use a subsection for the new data. There's some
reasonably good documentation on how to do that in
docs/migration.txt (in the 'Subsections' subsection :-)).

> (As far as I can tell, this only matters for migration of SD interfaces
> across qemu versions, where the previous state was saved in the window
> between reset and driver initialisation.)

If you just add fields, as your patch does, then you break migration
completely across versions, whatever the state of the incoming
device, because the size of the data incoming will be different.
If you don't bump the version number in the vmstate struct then
it will go wrong in a confusing way whereby the reader gets out
of sync with the incoming data (probably resulting in an error
when the next device along tries to slurp in its data). If you
do bump the version number you at least get a comprehensible
error message. (This all happens because our migration data
stream is not self-describing: we rely on both ends having the
same interpretation of the serialised data.)

thanks
-- PMM

  reply	other threads:[~2016-01-25 18:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 19:02 [Qemu-devel] [PATCH v2 0/3] SD emulation fixes for Pi2 Tianocore EDK2 UEFI Andrew Baumann
2015-12-16 19:02 ` [Qemu-devel] [PATCH v2 1/3] hw/sd: implement CMD23 (SET_BLOCK_COUNT) for MMC compatibility Andrew Baumann
2015-12-16 19:02 ` [Qemu-devel] [PATCH v2 2/3] hw/sd: model a power-up delay, as a workaround for an EDK2 bug Andrew Baumann
2015-12-20 22:57   ` Peter Crosthwaite
2015-12-21 21:04     ` Andrew Baumann
2015-12-21 21:43       ` Peter Crosthwaite
2015-12-21 21:46   ` Peter Crosthwaite
2015-12-21 22:25     ` Andrew Baumann
2015-12-21 22:57       ` Peter Crosthwaite
2015-12-23 19:08         ` Andrew Baumann
2015-12-23 19:20       ` Peter Maydell
2015-12-23 19:37         ` Andrew Baumann
2016-01-25 18:33           ` Peter Maydell [this message]
2015-12-16 19:02 ` [Qemu-devel] [PATCH v2 3/3] hw/sd: use guest error logging rather than fprintf to stderr Andrew Baumann
2015-12-20 23:02   ` Peter Crosthwaite
2016-01-25 13:56 ` [Qemu-devel] [PATCH v2 0/3] SD emulation fixes for Pi2 Tianocore EDK2 UEFI Peter Maydell
2016-01-25 18:06   ` Andrew Baumann
2016-01-25 18:36     ` Peter Maydell
2016-02-01 22:17       ` Andrew Baumann

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=CAFEAcA9wrEjCnskcnaq35+ojurbrq-c5CM4LZznht1gCiTTn5Q@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@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 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.