From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsuDN-0005yS-9d for qemu-devel@nongnu.org; Thu, 14 May 2015 10:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsuDJ-0000vP-EN for qemu-devel@nongnu.org; Thu, 14 May 2015 10:34:21 -0400 Message-ID: <5554B25E.1090208@redhat.com> Date: Thu, 14 May 2015 16:34:06 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1431530311-21647-1-git-send-email-yarygin@linux.vnet.ibm.com> <55536C6B.4040400@redhat.com> <87vbfw77xb.fsf@linux.vnet.ibm.com> <55548F90.8010709@redhat.com> <878ucr9qri.fsf@linux.vnet.ibm.com> In-Reply-To: <878ucr9qri.fsf@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [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 Cc: Cornelia Huck , Christian Borntraeger , Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org On 14/05/2015 16:29, Alexander Yarygin wrote: > > Perhaps you can rename bdrv_drain_one to bdrv_flush_io_queue (inlining > > the existing bdrv_flush_io_queue into it)? That would work very well > > for me. > > Hmm, bdrv_flush_io_queue() is public, but has no users. How about > different name, maybe something like "bdrv_drain_requests_one" or so? It's common for functions to call a driver hook, and then follow up with generic code. See bdrv_truncate for an example. I would just keep bdrv_flush_io_queue(); bdrv_start_throttled_reqs is really the generic code to flush the I/O queue. Perhaps, if you prefer, move bdrv_requests_pending(bs) to the callers so that it keeps returning void? Paolo