aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio.c
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@baidu.com>2019-06-26 10:31:29 +0800
committerMichael S. Tsirkin <mst@redhat.com>2019-07-04 17:00:32 -0400
commit8b04e2c797b01a4baf379ec4f40b3f0e9cdf7a25 (patch)
tree14a89e97c5b61af783cdf0a7e77b6ff7521481e1 /hw/virtio/virtio.c
parent868a8f44f57f15670b30631a95e3e31e5cf268d0 (diff)
downloadqemu-8b04e2c797b01a4baf379ec4f40b3f0e9cdf7a25.zip
qemu-8b04e2c797b01a4baf379ec4f40b3f0e9cdf7a25.tar.gz
qemu-8b04e2c797b01a4baf379ec4f40b3f0e9cdf7a25.tar.bz2
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>
Diffstat (limited to 'hw/virtio/virtio.c')
-rw-r--r--hw/virtio/virtio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5fd25d9..e098fc8 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -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);
+ }
}
}