From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsZex-0008UT-S4 for qemu-devel@nongnu.org; Wed, 13 May 2015 12:37:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsZes-0005XY-O5 for qemu-devel@nongnu.org; Wed, 13 May 2015 12:37:27 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:34405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsZes-0005XC-E0 for qemu-devel@nongnu.org; Wed, 13 May 2015 12:37:22 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 May 2015 17:37:21 +0100 From: Alexander Yarygin References: <1431530311-21647-1-git-send-email-yarygin@linux.vnet.ibm.com> Date: Wed, 13 May 2015 19:37:15 +0300 In-Reply-To: (Alberto Garcia's message of "Wed, 13 May 2015 18:02:31 +0200") Message-ID: <87r3qk77t0.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, Christian Borntraeger , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini Alberto Garcia writes: > On Wed 13 May 2015 05:18:31 PM CEST, Alexander Yarygin wrote: > >> + if (!aio_ctxs || !g_list_find(aio_ctxs, aio_context)) { >> + busy |= aio_poll(aio_context, busy); >> + aio_ctxs = g_list_append(aio_ctxs, aio_context); >> + } > > g_list_append() walks the whole list in order to append an element, I > think you should use _prepend() instead. > > And since that's the only operation you're doing you can use a GSList > instead. > > Berto This seems reasonable, thanks.