virtio: Make sure we get correct state of device on handle_aio_output()

We should set the flags: "start_on_kick" and "started" after we call
the kick functions (handle_aio_output() and handle_output()).

Signed-off-by: Xie Yongji <xieyongji@baidu.com>
Message-Id: <20190626023130.31315-5-xieyongji@baidu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Xie Yongji
2019-07-04 17:00:32 -04:00
committed by Michael S. Tsirkin
parent 868a8f44f5
commit 8b04e2c797
+3 -3
View File
@@ -1571,10 +1571,10 @@ void virtio_queue_notify(VirtIODevice *vdev, int n)
event_notifier_set(&vq->host_notifier);
} else if (vq->handle_output) {
vq->handle_output(vdev, vq);
}
if (unlikely(vdev->start_on_kick)) {
virtio_set_started(vdev, true);
if (unlikely(vdev->start_on_kick)) {
virtio_set_started(vdev, true);
}
}
}