From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0v8S-0005A8-Aq for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:42:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0v8O-0008S3-UT for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:42:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0v8O-0008Rr-PV for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:42:36 -0500 References: <564EE92E.4070701@cn.fujitsu.com> From: Paolo Bonzini Message-ID: <56535008.4010304@redhat.com> Date: Mon, 23 Nov 2015 18:42:32 +0100 MIME-Version: 1.0 In-Reply-To: <564EE92E.4070701@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [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: Wen Congyang , qemu-devl On 20/11/2015 10:34, Wen Congyang wrote: > 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(); > Queued for 2.5-rc2, thanks!