From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9UTx-0002c3-Al for qemu-devel@nongnu.org; Thu, 17 Dec 2015 04:04:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9UTt-0001PR-6q for qemu-devel@nongnu.org; Thu, 17 Dec 2015 04:04:17 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:34935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9UTt-0001PN-14 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 04:04:13 -0500 Received: by mail-wm0-x236.google.com with SMTP id l126so11333571wml.0 for ; Thu, 17 Dec 2015 01:04:12 -0800 (PST) Sender: Paolo Bonzini References: <1450290827-30508-4-git-send-email-pbonzini@redhat.com> <20151217021444.GE20007@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <56727A85.3020308@redhat.com> Date: Thu, 17 Dec 2015 10:04:05 +0100 MIME-Version: 1.0 In-Reply-To: <20151217021444.GE20007@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH untested] mirror: start drained section earlier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org On 17/12/2015 03:14, Fam Zheng wrote: > @@ -388,7 +390,9 @@ static void mirror_exit(BlockJob *job, void *opaque) > bdrv_unref(s->target); > block_job_completed(&s->common, data->ret); > g_free(data); > - bdrv_drained_end(src); > + if (drained_begin) { > + bdrv_drained_end(src); > + } > bdrv_unref(src); > } > > @@ -571,6 +575,7 @@ static void coroutine_fn mirror_run(void *opaque) > */ > assert(QLIST_EMPTY(&bs->tracked_requests)); > s->common.cancelled = false; > + s->drained_begin = true; > break; > } > bdrv_drained_end(s->common.bs); > Good point, thanks! Paolo