Received: from eggs.gnu.org ([2001:4830:134:3::10]:51601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP9ri-0004lb-El for qemu-devel@nongnu.org; Fri, 29 Jan 2016 09:17:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aP9rf-0001wa-7y for qemu-devel@nongnu.org; Fri, 29 Jan 2016 09:17:34 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:38578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP9re-0001wW-U2 for qemu-devel@nongnu.org; Fri, 29 Jan 2016 09:17:31 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Jan 2016 14:17:29 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 27D4817D805A for ; Fri, 29 Jan 2016 14:17:37 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0TEHRAT7930312 for ; Fri, 29 Jan 2016 14:17:27 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0TEHQe2018114 for ; Fri, 29 Jan 2016 07:17:27 -0700 Date: Fri, 29 Jan 2016 15:17:24 +0100 From: Cornelia Huck Message-ID: <20160129151724.474350cb.cornelia.huck@de.ibm.com> In-Reply-To: <1454073536-19963-1-git-send-email-dgilbert@redhat.com> References: <1454073536-19963-1-git-send-email-dgilbert@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix virtio migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: amit.shah@redhat.com, quintela@redhat.com, silbe@linux.vnet.ibm.com, qemu-devel@nongnu.org, mst@redhat.com On Fri, 29 Jan 2016 13:18:56 +0000 "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > I misunderstood the vmstate macro definition when I reworked the > virtio .get/.put. > The VMSTATE_STRUCT_VARRAY_KNOWN, was described as being for "a > variable length array (i.e. _type *_field) but we know the > length". However it actually specified operation for arrays embedded in > the struct (i.e. _type _field[]) since it lacked the VMS_POINTER > flag. This caused offset calculation to be completely off, examining and > potentially sending random data instead of the VirtQueue content. > > Replace the otherwise unused VMSTATE_STRUCT_VARRAY_KNOWN with a > VMSTATE_STRUCT_VARRAY_POINTER_KNOWN that includes the VMS_POINTER flag > (so now actually doing what it advertises) and use it in the virtio > migration code. > > Fixes and description as per Sascha's suggestions/debug. > > Signed-off-by: Dr. David Alan Gilbert > Reported-by: Sascha Silbe > Tested-By: Sascha Silbe > Reviewed-By: Sascha Silbe > > Fixes: 50e5ae4dc3e4f21e874512f9e87b93b5472d26e0 > Fixes: 2cf0148674430b6693c60d42b7eef721bfa9509f > --- > hw/virtio/virtio.c | 8 ++++---- > include/migration/vmstate.h | 18 +++++++++--------- > 2 files changed, 13 insertions(+), 13 deletions(-) Tested-by: Cornelia Huck