diff options
| author | Fam Zheng | 2017-02-09 09:40:47 +0100 |
|---|---|---|
| committer | Michael S. Tsirkin | 2017-02-17 20:52:30 +0100 |
| commit | 0793169870f376bc9959b7d81df48ab4a90dcceb (patch) | |
| tree | 706cd7d990534f97bcf1dd9ca8ca09c4e7d350ff /hw/block/dataplane | |
| parent | pci/pcie: don't assume cap id 0 is reserved (diff) | |
| download | qemu-0793169870f376bc9959b7d81df48ab4a90dcceb.tar.gz qemu-0793169870f376bc9959b7d81df48ab4a90dcceb.tar.xz qemu-0793169870f376bc9959b7d81df48ab4a90dcceb.zip | |
virtio: Report real progress in VQ aio poll handler
In virtio_queue_host_notifier_aio_poll, not all "!virtio_queue_empty()"
cases are making true progress.
Currently the offending one is virtio-scsi event queue, whose handler
does nothing if no event is pending. As a result aio_poll() will spin on
the "non-empty" VQ and take 100% host CPU.
Fix this by reporting actual progress from virtio queue aio handlers.
Reported-by: Ed Swierk <eswierk@skyportsystems.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Tested-by: Ed Swierk <eswierk@skyportsystems.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/block/dataplane')
| -rw-r--r-- | hw/block/dataplane/virtio-blk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index d1f9f63eaf..5556f0e64e 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -147,7 +147,7 @@ void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s) g_free(s); } -static void virtio_blk_data_plane_handle_output(VirtIODevice *vdev, +static bool virtio_blk_data_plane_handle_output(VirtIODevice *vdev, VirtQueue *vq) { VirtIOBlock *s = (VirtIOBlock *)vdev; @@ -155,7 +155,7 @@ static void virtio_blk_data_plane_handle_output(VirtIODevice *vdev, assert(s->dataplane); assert(s->dataplane_started); - virtio_blk_handle_vq(s, vq); + return virtio_blk_handle_vq(s, vq); } /* Context: QEMU global mutex held */ |
