Received: from eggs.gnu.org ([2001:4830:134:3::10]:50107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsZ7z-0000Ky-TJ for qemu-devel@nongnu.org; Wed, 13 May 2015 12:03:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsZ7v-00064u-J3 for qemu-devel@nongnu.org; Wed, 13 May 2015 12:03:23 -0400 From: Alberto Garcia In-Reply-To: <1431530311-21647-1-git-send-email-yarygin@linux.vnet.ibm.com> References: <1431530311-21647-1-git-send-email-yarygin@linux.vnet.ibm.com> Date: Wed, 13 May 2015 18:02:31 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Alexander Yarygin , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Christian Borntraeger , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini 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