From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVjH2-0003sh-Nr for qemu-devel@nongnu.org; Wed, 30 Nov 2011 07:28:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVjH1-0008JR-Eq for qemu-devel@nongnu.org; Wed, 30 Nov 2011 07:28:28 -0500 Received: from verein.lst.de ([213.95.11.211]:58470 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVjH1-0008In-AR for qemu-devel@nongnu.org; Wed, 30 Nov 2011 07:28:27 -0500 Date: Wed, 30 Nov 2011 13:28:26 +0100 From: Christoph Hellwig Message-ID: <20111130122826.GA16826@lst.de> References: <1322655824-31778-1-git-send-email-stefanha@linux.vnet.ibm.com> <1322655824-31778-4-git-send-email-stefanha@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1322655824-31778-4-git-send-email-stefanha@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 3/3] block: convert qemu_aio_flush() calls to bdrv_drain_all() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org On Wed, Nov 30, 2011 at 12:23:43PM +0000, Stefan Hajnoczi wrote: > Many places in QEMU call qemu_aio_flush() to complete all pending > asynchronous I/O. Most of these places actually want to drain all block > requests but there is block layer API to do so. there seems to be a "not" missing in the last half sentence. > > This patch introduces the bdrv_drain_all() API to wait for requests > across all BlockDriverStates to complete. As a bonus we perform checks > after qemu_aio_wait() to ensure that requests really have finished. It looks like all but four of the callers actually just want to drain a single BlockDriverState. And one of those four already has its own loop over all BlockDriverStates.