From 8b04e2c797b01a4baf379ec4f40b3f0e9cdf7a25 Mon Sep 17 00:00:00 2001 From: Xie Yongji Date: Wed, 26 Jun 2019 10:31:29 +0800 Subject: 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 Message-Id: <20190626023130.31315-5-xieyongji@baidu.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hw/virtio/virtio.c') diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 5fd25d98a9..e098fc8ef0 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); + } } } -- cgit v1.2.3