From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPA7s-00013f-2C for qemu-devel@nongnu.org; Fri, 29 Jan 2016 09:34:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPA7n-00062I-V5 for qemu-devel@nongnu.org; Fri, 29 Jan 2016 09:34:15 -0500 Received: from mail-vk0-x22a.google.com ([2607:f8b0:400c:c05::22a]:35973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPA7n-000624-F3 for qemu-devel@nongnu.org; Fri, 29 Jan 2016 09:34:11 -0500 Received: by mail-vk0-x22a.google.com with SMTP id n1so42754103vkb.3 for ; Fri, 29 Jan 2016 06:34:11 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1454073536-19963-1-git-send-email-dgilbert@redhat.com> References: <1454073536-19963-1-git-send-email-dgilbert@redhat.com> From: Peter Maydell Date: Fri, 29 Jan 2016 14:33:51 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 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: Juan Quintela , "Michael S. Tsirkin" , QEMU Developers , Amit Shah , Cornelia Huck , Sascha Silbe On 29 January 2016 at 13:18, 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. Yeah, these macro names are a bit of a mess. I had an idea ages back about autogenerating them all as an orthogonal cross product of the different kinds of thing (and filling in some of the random gaps in coverage as a side effect), but I never really got anywhere with it. thanks -- PMM