]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio: Make sure we get correct state of device on handle_aio_output()
authorXie Yongji <xieyongji@baidu.com>
Wed, 26 Jun 2019 02:31:29 +0000 (10:31 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 4 Jul 2019 21:00:32 +0000 (17:00 -0400)
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>
hw/virtio/virtio.c

index 5fd25d98a97e240291084b36095ff6fbafcb0e20..e098fc8ef0668cdadfb06021bca82a73b8d11e15 100644 (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);
+        }
     }
 }