From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDZ5n-0007Rq-Te for qemu-devel@nongnu.org; Fri, 30 Mar 2012 06:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDZ5h-0004Vd-L3 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 06:30:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDZ5h-0004SE-D2 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 06:29:57 -0400 Message-ID: <4F758B1D.10505@redhat.com> Date: Fri, 30 Mar 2012 12:29:49 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1333037320-20564-1-git-send-email-pbonzini@redhat.com> <20120330071921.GB16159@stefanha-thinkpad.localdomain> <4F756F51.5010603@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block: fix streaming/closing race List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Il 30/03/2012 12:25, Stefan Hajnoczi ha scritto: > On Fri, Mar 30, 2012 at 9:31 AM, Paolo Bonzini wrote: >> Il 30/03/2012 09:19, Stefan Hajnoczi ha scritto: >>>>> +void block_job_cancel_sync(BlockJob *job) >>>>> +{ >>>>> + BlockDriverState *bs = job->bs; >>>>> + >>>>> + assert(bs->job == job); >>>>> + block_job_cancel(job); >>>>> + while (bs->job != NULL && bs->job->busy) { >>> It's not clear to me why we have a busy flag. >> >> Because the coroutine does not restart if you do qemu_aio_wait and the >> coroutine is waiting in co_sleep. So the busy flag communicates that >> the coroutine is quiescent and, when cancelled, will not issue any new I/O. > > Ah, yes. This is tricky, a comment would be nice. I'll just add gtkdoc comments for the blockjob interface. We need to start somewhere... Paolo