From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD6e5-0001hg-QQ for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:57:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bD6e0-0007iG-SK for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:57:56 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD6e0-0007hu-Ls for qemu-devel@nongnu.org; Wed, 15 Jun 2016 04:57:52 -0400 Received: by mail-wm0-x242.google.com with SMTP id k184so4199525wme.2 for ; Wed, 15 Jun 2016 01:57:52 -0700 (PDT) Sender: Paolo Bonzini References: <1465928228-1184-1-git-send-email-stefanha@redhat.com> <1465928228-1184-5-git-send-email-stefanha@redhat.com> From: Paolo Bonzini Message-ID: <5cd43fbb-b9ef-ba1c-ea33-a0abf91346ec@redhat.com> Date: Wed, 15 Jun 2016 10:57:49 +0200 MIME-Version: 1.0 In-Reply-To: <1465928228-1184-5-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 4/5] 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 , Fam Zheng , Jeff Cody , mreitz@redhat.com, jjherne@linux.vnet.ibm.com On 14/06/2016 20:17, Stefan Hajnoczi wrote: > +/* There is no matching mirror_resume() because mirror_run() will begin > + * iterating again when the job is resumed. > + */ > +static void mirror_pause(BlockJob *job) > +{ > + MirrorBlockJob *s = container_of(job, MirrorBlockJob, common); > + > + while (s->in_flight > 0) { > + aio_poll(blk_get_aio_context(job->blk), true); > + } This is calling aio_poll from a coroutine, which is ugly -- see Fam's recent introduction of bdrv_co_drain. I think this should call mirror_drain instead. Paolo > +} > +