From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfU2T-0006GL-HN for qemu-devel@nongnu.org; Tue, 07 Apr 2015 09:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfU2Q-000418-Rz for qemu-devel@nongnu.org; Tue, 07 Apr 2015 09:59:37 -0400 Date: Tue, 7 Apr 2015 15:59:29 +0200 From: Alberto Garcia Message-ID: <20150407135929.GA1655@igalia.com> References: <1428069921-2957-1-git-send-email-famz@redhat.com> <1428069921-2957-3-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428069921-2957-3-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/4] block: Pause block jobs in bdrv_drain_all List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-block@nongnu.org, Jeff Cody , qemu-devel@nongnu.org, Stefan Hajnoczi , pbonzini@redhat.com On Fri, Apr 03, 2015 at 10:05:19PM +0800, Fam Zheng wrote: > + QTAILQ_FOREACH(bs, &bdrv_states, device_list) { > + AioContext *aio_context = bdrv_get_aio_context(bs); > + > + aio_context_acquire(aio_context); > + if (bs->job) { > + block_job_pause(bs->job); > + } > + aio_context_release(aio_context); > + } Not directly a problem in your code, but since I'm playing with the idea of allowing block jobs to reside in any arbitrary node we'll have to figure out a simple and global way to iterate over all block jobs. The one that I wrote is probably not the best one. Maybe we can have block_job_create/completed() maintain a list of jobs instead. https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg04800.html But anyway I don't think it's something for this patchset, therefore: Reviewed-by: Alberto Garcia Berto