From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YudDn-0002Cq-Vn for qemu-devel@nongnu.org; Tue, 19 May 2015 04:49:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YudDn-0007Qf-0k for qemu-devel@nongnu.org; Tue, 19 May 2015 04:49:55 -0400 Message-ID: <555AF925.6050809@redhat.com> Date: Tue, 19 May 2015 10:49:41 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1432036186-29903-1-git-send-email-famz@redhat.com> <1432036186-29903-14-git-send-email-famz@redhat.com> <555AEEA3.4080407@redhat.com> <20150519164816.GA5375@cpc-pc.redhat.com> In-Reply-To: <20150519164816.GA5375@cpc-pc.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 13/13] block/mirror: Block "device IO" during mirror exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-block@nongnu.org, "Michael S. Tsirkin" , Juan Quintela , qemu-devel@nongnu.org, mreitz@redhat.com, Stefan Hajnoczi , Amit Shah On 19/05/2015 18:48, Fam Zheng wrote: >> > >> > This is too late. As a rule, the blocker must be established before >> > calling bdrv_drain, and removed on the next yield (in this case, before >> > the assignment to last_pause_ns). > I don't understand. If the blocker is removed before mirror_run returns, > wouldn't more device IO already hit source image by the time mirror_exit runs? If you go to mirror_exit, you won't reach the assignment (so you have to remove the blocker in mirror_exit too). But if you don't go to mirror_exit because cnt != 0, you must remove the blocker before the next I/O. Paolo