qemu-e2k/hw/virtio
Dr. David Alan Gilbert 3e996cc583 Fix virtio migration
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 <dgilbert@redhat.com>
Reported-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Tested-By: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-By: Sascha Silbe <silbe@linux.vnet.ibm.com>

Fixes: 50e5ae4dc3
Fixes: 2cf0148674
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-02-04 19:53:02 +02:00
..
dataplane virtio: Clean up includes 2016-01-29 15:07:23 +00:00
Makefile.objs dataplane: endianness-aware accesses 2015-02-16 15:07:16 +00:00
vhost-backend.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
vhost-user.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
vhost.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
virtio-balloon.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
virtio-bus.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
virtio-mmio.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
virtio-pci.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
virtio-pci.h 9pfs: introduce V9fsVirtioState 2016-01-12 11:04:14 +05:30
virtio-rng.c virtio: Clean up includes 2016-01-29 15:07:23 +00:00
virtio.c Fix virtio migration 2016-02-04 19:53:02 +02:00