From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCRR3-0008Qd-ET for qemu-devel@nongnu.org; Fri, 14 Sep 2012 04:39:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCRQu-0006EY-O2 for qemu-devel@nongnu.org; Fri, 14 Sep 2012 04:39:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCRQu-0006EJ-Fq for qemu-devel@nongnu.org; Fri, 14 Sep 2012 04:39:28 -0400 From: Juan Quintela In-Reply-To: (Jason Baron's message of "Thu, 13 Sep 2012 16:12:47 -0400") References: Date: Fri, 14 Sep 2012 10:38:00 +0200 Message-ID: <87ipbht2xj.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 19/25] ahci: add migration support Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Baron Cc: kwolf@redhat.com, aliguori@us.ibm.com, alex.williamson@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, agraf@suse.de, yamahata@valinux.co.jp, juzhang@redhat.com, kevin@koconnor.net, avi@redhat.com, mkletzan@redhat.com, i.mitsyanko@samsung.com, lcapitulino@redhat.com, afaerber@suse.de, armbru@redhat.com Jason Baron wrote: > Add support for ahci migration. This patch builds upon the patches origin= ally > posted by Andreas F=C3=A4rber. > > These patches have been tested by migrating Windows 7 and Fedora 16 guest= s on > both piix with ahci attached and on q35 (which has a built-in ahci contro= ller). > +const VMStateDescription vmstate_ahci =3D { > + .name =3D "ahci", > + .version_id =3D 1, > + .post_load =3D ahci_state_post_load, > + .fields =3D (VMStateField []) { + VMSTATE_INT32_EQUAL(ports, AHCIState), > + VMSTATE_STRUCT_VARRAY_POINTER_INT32(dev, AHCIState, ports, > + vmstate_ahci_device, AHCIDevice), > + VMSTATE_UINT32(control_regs.cap, AHCIState), > + VMSTATE_UINT32(control_regs.ghc, AHCIState), > + VMSTATE_UINT32(control_regs.irqstatus, AHCIState), > + VMSTATE_UINT32(control_regs.impl, AHCIState), > + VMSTATE_UINT32(control_regs.version, AHCIState), > + VMSTATE_UINT32(idp_index, AHCIState), > + VMSTATE_END_OF_LIST() > + }, > +}; > + Only comment that I have is if we can add that bit on the vmstate transition. That way we can detect when the number of ports between the two instances are different. You can change it to; (it checks that ports received is less ore equal than original value): + VMSTATE_INT32_LE(ports, AHCIState), If the code will work if we transfer less ports that are active. I have no clue which one makes more sense from the ahci point of view. Thanks, Juan.