From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUXOF-0007JS-Ue for qemu-devel@nongnu.org; Tue, 02 Aug 2016 06:57:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUXOD-0004YF-8w for qemu-devel@nongnu.org; Tue, 02 Aug 2016 06:57:39 -0400 Received: from [59.151.112.132] (port=64110 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUXOC-0004XV-RS for qemu-devel@nongnu.org; Tue, 02 Aug 2016 06:57:37 -0400 References: <1470134071-29526-1-git-send-email-pbonzini@redhat.com> From: Cao jin Message-ID: <57A07E73.7040704@cn.fujitsu.com> Date: Tue, 2 Aug 2016 19:05:23 +0800 MIME-Version: 1.0 In-Reply-To: <1470134071-29526-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] mptsas: really fix migration compatibility List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: Markus Armbruster , Marcel Apfelbaum , "Michael S . Tsirkin" , Amit Shah 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 > Suggested-by: Amit Shah > Cc: Markus Armbruster > Cc: Marcel Apfelbaum > Cc: Paolo Bonzini > Cc: Michael S. Tsirkin > Cc: Amit Shah > Cc: Cao jin > Signed-off-by: Paolo Bonzini > --- > 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