Received: from eggs.gnu.org ([2001:4830:134:3::10]:49592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yt9hn-0002Bd-SY for qemu-devel@nongnu.org; Fri, 15 May 2015 03:06:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yt9hk-0006S5-Ei for qemu-devel@nongnu.org; Fri, 15 May 2015 03:06:47 -0400 Date: Fri, 15 May 2015 15:06:37 +0800 From: Fam Zheng Message-ID: <20150515070637.GB13255@ad.nay.redhat.com> References: <1431669868-26804-1-git-send-email-famz@redhat.com> <1431669868-26804-2-git-send-email-famz@redhat.com> <555590B1.1050104@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <555590B1.1050104@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH v3 01/12] block: Add op blocker type "device IO" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang Cc: Kevin Wolf , qemu-block@nongnu.org, armbru@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, Stefan Hajnoczi , pbonzini@redhat.com On Fri, 05/15 14:22, Wen Congyang wrote: > On 05/15/2015 02:04 PM, Fam Zheng wrote: > > It blocks device IO. > > I am reading mirror codes recently, and have a question: > When block job mirror is finished, the source and target is synced. But we > call bdrv_swap() later(in bh context). Can the guest write something to > the source before the bh is scheduled? If the answer is yes, I think > we should use this to block the guest's disk I/O. I think you're right. After mirror_run returns, anything can happen on this aio context, including guest writing. Fam