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-06-26 10:31:29 +08:00 committed by Michael S. Tsirkin
parent 868a8f44f5
commit 8b04e2c797
1 changed files with 3 additions and 3 deletions

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);
}
}
}