From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCnAG-0004O7-NS for qemu-devel@nongnu.org; Tue, 14 Jun 2016 08:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCnAC-0001d2-3b for qemu-devel@nongnu.org; Tue, 14 Jun 2016 08:09:51 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:36756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCnAB-0001cR-TY for qemu-devel@nongnu.org; Tue, 14 Jun 2016 08:09:48 -0400 Received: by mail-wm0-x230.google.com with SMTP id n184so118689020wmn.1 for ; Tue, 14 Jun 2016 05:09:47 -0700 (PDT) Sender: Paolo Bonzini References: <1465837535-30067-1-git-send-email-stefanha@redhat.com> <1465837535-30067-16-git-send-email-stefanha@redhat.com> From: Paolo Bonzini Message-ID: <45cd8620-2bcb-18ab-0d1a-d0921428ab0f@redhat.com> Date: Tue, 14 Jun 2016 14:09:44 +0200 MIME-Version: 1.0 In-Reply-To: <1465837535-30067-16-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 15/15] mirror: follow AioContext change gracefully List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , jjherne@linux.vnet.ibm.com, Fam Zheng , Jeff Cody , mreitz@redhat.com On 13/06/2016 19:05, Stefan Hajnoczi wrote: > index 80fd3c7..046e95c 100644 > --- a/block/mirror.c > +++ b/block/mirror.c > @@ -331,6 +331,8 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) > mirror_wait_for_io(s); > } > > + block_job_pause_point(&s->common); I/O can be in-flight here, so your description of the function is not 100% accurate. I suppose it's okay because s->waiting_for_io is false at the pause points you specified? I guess a comment that explains it will do; and apart from this detail, the patches are really nice. Or maybe it's just that you scared with that 00/15 in the cover letter. :-> Paolo > cnt = bdrv_get_dirty_count(s->dirty_bitmap); > /* s->common.offset contains the number of bytes already processed so > * far, cnt is the number of dirty sectors remaining and > @@ -781,18 +787,38 @@ static void mirror_complete(BlockJob *job, Error **errp) > block_job_enter(&s->common); > }