From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrswG-0002J9-AM for qemu-devel@nongnu.org; Tue, 03 Jun 2014 13:56:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wrsw4-0003um-Jc for qemu-devel@nongnu.org; Tue, 03 Jun 2014 13:55:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrsw3-0003uW-S3 for qemu-devel@nongnu.org; Tue, 03 Jun 2014 13:55:44 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s53Htf86000685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 3 Jun 2014 13:55:42 -0400 Message-ID: <538E0C19.5030108@redhat.com> Date: Tue, 03 Jun 2014 19:55:37 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1401561792-13410-1-git-send-email-mreitz@redhat.com> <1401561792-13410-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1401561792-13410-3-git-send-email-mreitz@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: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Stefan Hajnoczi 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. Paolo