From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6zfY-0004kZ-Na for qemu-devel@nongnu.org; Mon, 12 Mar 2012 03:27:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6zfW-0007kE-NM for qemu-devel@nongnu.org; Mon, 12 Mar 2012 03:27:47 -0400 Received: from plane.gmane.org ([80.91.229.3]:38617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6zfW-0007jr-Gc for qemu-devel@nongnu.org; Mon, 12 Mar 2012 03:27:46 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S6zfR-00011h-O7 for qemu-devel@nongnu.org; Mon, 12 Mar 2012 08:27:41 +0100 Received: from 93-34-182-16.ip50.fastwebnet.it ([93.34.182.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Mar 2012 08:27:41 +0100 Received: from pbonzini by 93-34-182-16.ip50.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Mar 2012 08:27:41 +0100 From: Paolo Bonzini Date: Mon, 12 Mar 2012 08:27:31 +0100 Message-ID: References: <1331533744-15802-1-git-send-email-zwu.kernel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit In-Reply-To: <1331533744-15802-1-git-send-email-zwu.kernel@gmail.com> Subject: Re: [Qemu-devel] [PATCH v2 1/2] block: add the support to drain throttled requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Il 12/03/2012 07:29, zwu.kernel@gmail.com ha scritto: > From: Zhi Yong Wu > > Signed-off-by: Zhi Yong Wu > --- > block.c | 21 +++++++++++++++++++++ > block_int.h | 1 + > 2 files changed, 22 insertions(+), 0 deletions(-) > > diff --git a/block.c b/block.c > index 52ffe14..0825168 100644 > --- a/block.c > +++ b/block.c > @@ -853,6 +853,21 @@ void bdrv_close_all(void) > } > } > > +/** > + * Complete all pending requests for a block device > + */ > +void bdrv_drain(BlockDriverState *bs) > +{ > + do { > + qemu_co_queue_restart_all(&bs->throttled_reqs); > + } while (!qemu_co_queue_empty(&bs->throttled_reqs)); > + > + qemu_aio_flush(); This doesn't work, qemu_aio_flush can start new I/O. Paolo