From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsblx-0004CJ-Ns for qemu-devel@nongnu.org; Thu, 05 Jun 2014 13:48:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsblq-0003Bh-68 for qemu-devel@nongnu.org; Thu, 05 Jun 2014 13:48:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsblp-0003BK-UN for qemu-devel@nongnu.org; Thu, 05 Jun 2014 13:48:10 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s55HTDUI009814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 5 Jun 2014 13:29:14 -0400 Message-ID: <5390A8E5.2080602@redhat.com> Date: Thu, 05 Jun 2014 19:29:09 +0200 From: Max Reitz MIME-Version: 1.0 References: <1401561792-13410-1-git-send-email-mreitz@redhat.com> <1401561792-13410-3-git-send-email-mreitz@redhat.com> <538E0C19.5030108@redhat.com> In-Reply-To: <538E0C19.5030108@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 2/5] aio: Add io_read_poll() callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Stefan Hajnoczi 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