virtio-balloon: fix stats vq migration
commit4a1e48becab81020adfb74b22c76a595f2d02a01
authorLadi Prosek <lprosek@redhat.com>
Wed, 7 Sep 2016 15:20:49 +0000 (7 17:20 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 9 Sep 2016 17:58:34 +0000 (9 20:58 +0300)
tree42a01a634854359dd13197a8717036c4201cc111
parent297a75e6c55d91db2704a3d6e4029d99c7df51fd
virtio-balloon: fix stats vq migration

The statistics virtqueue is not migrated properly because virtio-balloon
does not include s->stats_vq_elem in the migration stream.

After migration the statistics virtqueue hangs because the host never
completes the last element (s->stats_vq_elem is NULL on the destination
QEMU).  Therefore the guest never submits new elements and the virtqueue
is hung.

Instead of changing the migration stream format in an incompatible way,
detect the migration case and rewind the virtqueue so the last element
can be completed.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Roman Kagan <rkagan@virtuozzo.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Suggested-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-balloon.c