aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-01-12 11:46:11 +0000
committerMichael S. Tsirkin <mst@redhat.com>2017-01-18 22:59:53 +0200
commit1448c133e19372359d9de68626c06088ba79a34b (patch)
tree564100eb7e05d387280baec5032d5e87e32f8a08 /hw/virtio/virtio.c
parent332fa82d0963409fa14997a02639289afa226596 (diff)
downloadqemu-1448c133e19372359d9de68626c06088ba79a34b.zip
qemu-1448c133e19372359d9de68626c06088ba79a34b.tar.gz
qemu-1448c133e19372359d9de68626c06088ba79a34b.tar.bz2
virtio: disable notifications again after poll succeeded
While AioContext is in polling mode virtqueue notifications are not necessary. Some device virtqueue handlers enable notifications. Make sure they stay disabled to avoid unnecessary vmexits. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Richard Henderson <rth@twiddle.net> Tested-by: Laszlo Ersek <lersek@redhat.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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index f04ab7a..34065c7 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2126,6 +2126,9 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque)
}
virtio_queue_notify_aio_vq(vq);
+
+ /* In case the handler function re-enabled notifications */
+ virtio_queue_set_notification(vq, 0);
return true;
}