From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK34i-0003cG-B1 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 07:02:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK34f-0003d7-4P for qemu-devel@nongnu.org; Fri, 15 Jan 2016 07:01:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK34e-0003d1-Sf for qemu-devel@nongnu.org; Fri, 15 Jan 2016 07:01:49 -0500 Date: Fri, 15 Jan 2016 12:01:44 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20160115120143.GB2432@work-vm> References: <1452083019-15141-1-git-send-email-dgilbert@redhat.com> <1452083019-15141-2-git-send-email-dgilbert@redhat.com> <871t9jhnfs.fsf@oc4731375738.ibm.com> <20160115092419.GA2432@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20160115092419.GA2432@work-vm> Subject: Re: [Qemu-devel] [PATCH 2/2] migration/virtio: Remove simple .get/.put use List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sascha Silbe Cc: amit.shah@redhat.com, Cornelia Huck , mst@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com Hi Sascha, Can you try this and let me know if it fixes it for you; I've still not managed to persuade x86-64 to fail. Dave =46rom f300fa0dd902b28417744d364986c71dd8357a88 Mon Sep 17 00:00:00 2001 =46rom: "Dr. David Alan Gilbert" Date: Fri, 15 Jan 2016 11:02:02 +0000 Subject: [PATCH] Fix virito migration I misunderstood the vmstate macro definition when I reworked the virtio .get/.put - but I can't get it to break for me, which suggests I'm perhaps not managing to get that structure into being sent in my tests. Fixes as per Sascha's suggestions/debug. Signed-off-by: Dr. David Alan Gilbert Reported-by: Sascha Silbe Fixes: 50e5ae4dc3e4f21e874512f9e87b93b5472d26e0 Fixes: 2cf0148674430b6693c60d42b7eef721bfa9509f --- hw/virtio/virtio.c | 8 ++++---- include/migration/vmstate.h | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index bd6b4df..41a8a8a 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1143,8 +1143,8 @@ static const VMStateDescription vmstate_virtio_virtqu= eues =3D { .minimum_version_id =3D 1, .needed =3D &virtio_virtqueue_needed, .fields =3D (VMStateField[]) { - VMSTATE_STRUCT_VARRAY_KNOWN(vq, struct VirtIODevice, VIRTIO_QUEUE_= MAX, - 0, vmstate_virtqueue, VirtQueue), + VMSTATE_STRUCT_VARRAY_POINTER_KNOWN(vq, struct VirtIODevice, + VIRTIO_QUEUE_MAX, 0, vmstate_virtqueue, VirtQueue), VMSTATE_END_OF_LIST() } }; @@ -1165,8 +1165,8 @@ static const VMStateDescription vmstate_virtio_ringsi= ze =3D { .minimum_version_id =3D 1, .needed =3D &virtio_ringsize_needed, .fields =3D (VMStateField[]) { - VMSTATE_STRUCT_VARRAY_KNOWN(vq, struct VirtIODevice, VIRTIO_QUEUE_= MAX, - 0, vmstate_ringsize, VirtQueue), + VMSTATE_STRUCT_VARRAY_POINTER_KNOWN(vq, struct VirtIODevice, + VIRTIO_QUEUE_MAX, 0, vmstate_ringsize, VirtQueue), VMSTATE_END_OF_LIST() } }; diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 97d44d3..4a5d1dd 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -374,19 +374,6 @@ extern const VMStateInfo vmstate_info_bitmap; .offset =3D vmstate_offset_array(_state, _field, _type, _num),\ } =20 -/* a variable length array (i.e. _type *_field) but we know the - * length - */ -#define VMSTATE_STRUCT_VARRAY_KNOWN(_field, _state, _num, _version, _vmsd,= _type) { \ - .name =3D (stringify(_field)), \ - .num =3D (_num), \ - .version_id =3D (_version), \ - .vmsd =3D &(_vmsd), \ - .size =3D sizeof(_type), \ - .flags =3D VMS_STRUCT|VMS_ARRAY, \ - .offset =3D offsetof(_state, _field), \ -} - #define VMSTATE_STRUCT_VARRAY_UINT8(_field, _state, _field_num, _version, = _vmsd, _type) { \ .name =3D (stringify(_field)), \ .num_offset =3D vmstate_offset_value(_state, _field_num, uint8_t), \ @@ -397,6 +384,19 @@ extern const VMStateInfo vmstate_info_bitmap; .offset =3D offsetof(_state, _field), \ } =20 +/* a variable length array (i.e. _type *_field) but we know the + * length + */ +#define VMSTATE_STRUCT_VARRAY_POINTER_KNOWN(_field, _state, _num, _version= , _vmsd, _type) { \ + .name =3D (stringify(_field)), \ + .num =3D (_num), \ + .version_id =3D (_version), \ + .vmsd =3D &(_vmsd), \ + .size =3D sizeof(_type), \ + .flags =3D VMS_STRUCT|VMS_ARRAY|VMS_POINTER, \ + .offset =3D offsetof(_state, _field), \ +} + #define VMSTATE_STRUCT_VARRAY_POINTER_INT32(_field, _state, _field_num, _v= msd, _type) { \ .name =3D (stringify(_field)), \ .version_id =3D 0, \ --=20 2.5.0 -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK