[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] mptsas: really fix migration compatibility
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH] mptsas: really fix migration compatibility |
Date: |
Tue, 2 Aug 2016 12:34:31 +0200 |
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 <address@hidden>
Suggested-by: Amit Shah <address@hidden>
Cc: Markus Armbruster <address@hidden>
Cc: Marcel Apfelbaum <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Michael S. Tsirkin <address@hidden>
Cc: Amit Shah <address@hidden>
Cc: Cao jin <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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;
--
2.7.4
- [Qemu-devel] [PATCH] mptsas: really fix migration compatibility,
Paolo Bonzini <=