|
From: | Max Reitz |
Subject: | Re: [Qemu-devel] [RFC 2/5] aio: Add io_read_poll() callback |
Date: | Thu, 05 Jun 2014 19:29:09 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 03.06.2014 19:55, Paolo Bonzini wrote:
Il 31/05/2014 20:43, Max Reitz ha scritto:@@ -108,7 +120,9 @@ bool aio_pending(AioContext *ctx) int revents; revents = node->pfd.revents & node->pfd.events;- if (revents & (G_IO_IN | G_IO_HUP | G_IO_ERR) && node->io_read) { + if (revents & (G_IO_IN | G_IO_HUP | G_IO_ERR) && node->io_read &&+ (!node->io_read_poll || node->io_read_poll(node->opaque))) + { return true; }This would cause a busy loop whenever io_read_poll returns false. You would need to call io_read_poll when you fill the pollfds array, i.e. in aio_poll and aio_ctx_prepare.
Thanks; considering Stefan's comment, I'll see whether I can get away without implement io_read_poll().
Max
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |