vu_cleanup() resets most virtqueue state (started, notification,
file descriptors) but does not reset the enable flag. After a
QEMU disconnect and reconnect, the stale enable flag causes
vu_set_vring_enable_exec() to hit its early return check
(vq->enable == enable).
Reset vq->enable to false in vu_cleanup() alongside the other
virtqueue state.
Signed-off-by: Laurent Vivier
Reviewed-by: David Gibson
---
vhost_user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/vhost_user.c b/vhost_user.c
index a1259c2624c0..272295f29db4 100644
--- a/vhost_user.c
+++ b/vhost_user.c
@@ -1081,6 +1081,7 @@ void vu_cleanup(struct vu_dev *vdev)
struct vu_virtq *vq = &vdev->vq[i];
vq->started = false;
+ vq->enable = false;
vq->notification = true;
if (vq->call_fd != -1) {
--
2.55.0