From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxyh0-00067N-SL for qemu-devel@nongnu.org; Thu, 28 May 2015 10:22:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxygz-0001Pg-SS for qemu-devel@nongnu.org; Thu, 28 May 2015 10:21:54 -0400 From: Paolo Bonzini Date: Thu, 28 May 2015 16:21:43 +0200 Message-Id: <1432822903-25821-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] blockdev: no need to drain in qmp_block_commit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , jcody@redhat.com, "open list:Block layer core" Draining is not necessary, I/O can happen as soon as the commit coroutine yields. Draining can be necessary before reopening the file for read/write, or while modifying the backing file chain, but that is done separately in bdrv_reopen_multiple or bdrv_close; this particular bdrv_drain_all does nothing for that. Signed-off-by: Paolo Bonzini --- blockdev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index d506a70..aee0395 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2355,9 +2355,6 @@ void qmp_block_commit(const char *device, aio_context = bdrv_get_aio_context(bs); aio_context_acquire(aio_context); - /* drain all i/o before commits */ - bdrv_drain_all(); - if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_COMMIT_SOURCE, errp)) { goto out; } -- 2.4.1