From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
Marcel Apfelbaum <marcel@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Amit Shah <amit.shah@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] mptsas: really fix migration compatibility
Date: Tue, 2 Aug 2016 19:05:23 +0800 [thread overview]
Message-ID: <57A07E73.7040704@cn.fujitsu.com> (raw)
In-Reply-To: <1470134071-29526-1-git-send-email-pbonzini@redhat.com>
On 08/02/2016 06:34 PM, Paolo Bonzini wrote:
> Commit 2e2aa316 removed internal flag msi_in_use, but it
> existed in vmstate. Restore it for migration to older QEMU
> versions.
>
> Reported-by: Amit Shah <amit.shah@redhat.com>
> Suggested-by: Amit Shah <amit.shah@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Amit Shah <amit.shah@redhat.com>
> Cc: Cao jin <caoj.fnst@cn.fujitsu.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> hw/scsi/mptsas.c | 4 +++-
> hw/scsi/mptsas.h | 2 ++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
> index bebe513..0e0a22f 100644
> --- a/hw/scsi/mptsas.c
> +++ b/hw/scsi/mptsas.c
> @@ -1295,6 +1295,8 @@ static void mptsas_scsi_init(PCIDevice *dev, Error **errp)
> /* With msi=auto, we fall back to MSI off silently */
> error_free(err);
>
> + /* Only used for migration. */
> + s->msi_in_use = (ret == 0);
> }
>
> memory_region_init_io(&s->mmio_io, OBJECT(s), &mptsas_mmio_ops, s,
> @@ -1370,7 +1372,7 @@ static const VMStateDescription vmstate_mptsas = {
> .post_load = mptsas_post_load,
> .fields = (VMStateField[]) {
> VMSTATE_PCI_DEVICE(dev, MPTSASState),
> - VMSTATE_UNUSED(sizeof(bool)), /* Was msi_in_use */
> + VMSTATE_BOOL(msi_in_use, MPTSASState),
> VMSTATE_UINT32(state, MPTSASState),
> VMSTATE_UINT8(who_init, MPTSASState),
> VMSTATE_UINT8(doorbell_state, MPTSASState),
> diff --git a/hw/scsi/mptsas.h b/hw/scsi/mptsas.h
> index da014a3..0436a33 100644
> --- a/hw/scsi/mptsas.h
> +++ b/hw/scsi/mptsas.h
> @@ -31,6 +31,8 @@ struct MPTSASState {
> OnOffAuto msi;
> uint64_t sas_addr;
>
> + bool msi_in_use;
> +
> /* Doorbell register */
> uint32_t state;
> uint8_t who_init;
>
Thanks for saving my mistake.
Just FYI: there is a superfluous newline in mptsas_scsi_init() made by
me, maybe is handy to remove.
--
Yours Sincerely,
Cao jin
prev parent reply other threads:[~2016-08-02 10:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 10:34 [Qemu-devel] [PATCH] mptsas: really fix migration compatibility Paolo Bonzini
2016-08-02 11:05 ` Cao jin [this message]
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=57A07E73.7040704@cn.fujitsu.com \
--to=caoj.fnst@cn.fujitsu.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--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 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).