From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1yqN-0005Fv-VK for qemu-devel@nongnu.org; Thu, 26 Nov 2015 10:52:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1yqN-0001iH-77 for qemu-devel@nongnu.org; Thu, 26 Nov 2015 10:52:23 -0500 From: Paolo Bonzini Date: Thu, 26 Nov 2015 16:52:10 +0100 Message-Id: <1448553137-22191-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1448553137-22191-1-git-send-email-pbonzini@redhat.com> References: <1448553137-22191-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 2/9] call bdrv_drain_all() even if the vm is stopped List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Wen Congyang 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 Message-Id: <564EE92E.4070701@cn.fujitsu.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- 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