Message ID | 1512148088-28733-4-git-send-email-mst@redhat.com |
---|---|
State | New |
Headers | show |
Series | [PULL,1/7] i386/msi: Correct mask of destination ID in MSI address | expand |
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index ddc42f0..5404194 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1138,6 +1138,10 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev, r = dev->vhost_ops->vhost_get_vring_base(dev, &state); if (r < 0) { VHOST_OPS_DEBUG("vhost VQ %d ring restore failed: %d", idx, r); + /* Connection to the backend is broken, so let's sync internal + * last avail idx to the device used idx. + */ + virtio_queue_restore_last_avail_idx(vdev, idx); } else { virtio_queue_set_last_avail_idx(vdev, idx, state.num); }