From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y13k6-0000Lt-V8 for qemu-devel@nongnu.org; Tue, 16 Dec 2014 20:49:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y13k0-000648-QZ for qemu-devel@nongnu.org; Tue, 16 Dec 2014 20:49:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y13k0-00063x-J6 for qemu-devel@nongnu.org; Tue, 16 Dec 2014 20:49:28 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBH1nRKc023952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 16 Dec 2014 20:49:27 -0500 Message-ID: <5490E126.6000100@redhat.com> Date: Tue, 16 Dec 2014 20:49:26 -0500 From: John Snow MIME-Version: 1.0 References: <1418780167-16231-1-git-send-email-jsnow@redhat.com> <1418780167-16231-15-git-send-email-jsnow@redhat.com> In-Reply-To: <1418780167-16231-15-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 14/17] ahci: Migrate IDEStatus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, mst@redhat.com, armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com On 12/16/2014 08:36 PM, John Snow wrote: > Amazingly, we weren't doing this before. > > Make sure we migrate the IDEState structure that belongs to > the AHCIDevice.IDEBus structure during migrations. > > No version numbering changes because AHCI is not officially > migratable (and we can all see with good reason why) so we > do not impact any official builds by altering the stream and > leaving it at version 1. > > This fixes the rerror=stop/werror=stop test case where we wish > to migrate a halted job. Previously, the error code would not > migrate, so even if the job completed successfully, AHCI would > report an error because it would still have the placeholder > error code from initialization time. > > Signed-off-by: John Snow > --- > hw/ide/ahci.c | 1 + > hw/ide/internal.h | 3 +++ > 2 files changed, 4 insertions(+) > > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > index bc6d5ce..3f4fc77 100644 > --- a/hw/ide/ahci.c > +++ b/hw/ide/ahci.c > @@ -1321,6 +1321,7 @@ static const VMStateDescription vmstate_ahci_device = { > .version_id = 1, > .fields = (VMStateField[]) { > VMSTATE_IDE_BUS(port, AHCIDevice), > + VMSTATE_IDE_DRIVE(port.ifs[0], AHCIDevice), > VMSTATE_UINT32(port_state, AHCIDevice), > VMSTATE_UINT32(finished, AHCIDevice), > VMSTATE_UINT32(port_regs.lst_addr, AHCIDevice), > diff --git a/hw/ide/internal.h b/hw/ide/internal.h > index 0beba43..c278dea 100644 > --- a/hw/ide/internal.h > +++ b/hw/ide/internal.h > @@ -524,6 +524,9 @@ extern const VMStateDescription vmstate_ide_drive; > #define VMSTATE_IDE_DRIVES(_field, _state) \ > VMSTATE_STRUCT_ARRAY(_field, _state, 2, 3, vmstate_ide_drive, IDEState) > > +#define VMSTATE_IDE_DRIVE(_field, _state) \ > + VMSTATE_STRUCT(_field, _state, 1, vmstate_ide_drive, IDEState) > + Please check that this versioning is sane; I tested that it let me migrate AHCI successfully, but I don't know if this is semantically "right." Please and thank you! --js > void ide_bus_reset(IDEBus *bus); > int64_t ide_get_sector(IDEState *s); > void ide_set_sector(IDEState *s, int64_t sector_num); >