From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zzi6g-0001JE-9s for qemu-devel@nongnu.org; Fri, 20 Nov 2015 04:35:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zzi6d-00058b-52 for qemu-devel@nongnu.org; Fri, 20 Nov 2015 04:35:50 -0500 Received: from [59.151.112.132] (port=35037 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zzi6c-00051J-Kc for qemu-devel@nongnu.org; Fri, 20 Nov 2015 04:35:47 -0500 From: Wen Congyang Message-ID: <564EE92E.4070701@cn.fujitsu.com> Date: Fri, 20 Nov 2015 17:34:38 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH for-2.5] call bdrv_drain_all() even if the vm is stopped List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devl , Paolo Bonzini There are still I/O operations when the vm is stopped. For example, stop the vm, and do block migration. In this case, we don't drain all I/O operation, and may meet the following problem: qemu-system-x86_64: migration/block.c:731: block_save_complete: Assertion `block_mig_state.submitted == 0' failed. Signed-off-by: Wen Congyang --- cpus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpus.c b/cpus.c index 877bd70..43676fa 100644 --- a/cpus.c +++ b/cpus.c @@ -1415,6 +1415,8 @@ int vm_stop_force_state(RunState state) return vm_stop(state); } else { runstate_set(state); + + bdrv_drain_all(); /* Make sure to return an error if the flush in a previous vm_stop() * failed. */ return bdrv_flush_all(); -- 2.5.0