From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REi76-0001Ak-Tg for qemu-devel@nongnu.org; Fri, 14 Oct 2011 09:47:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REi74-0002SQ-Lu for qemu-devel@nongnu.org; Fri, 14 Oct 2011 09:47:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REi74-0002Rt-DY for qemu-devel@nongnu.org; Fri, 14 Oct 2011 09:47:50 -0400 Message-ID: <4E983D7A.6020208@redhat.com> Date: Fri, 14 Oct 2011 15:47:38 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1318581692-18338-1-git-send-email-pbonzini@redhat.com> <1318581692-18338-3-git-send-email-pbonzini@redhat.com> <4E98183E.5040303@redhat.com> <4E981D6D.1070407@redhat.com> <4E982302.1030100@redhat.com> <20111014132002.GA1486@stefanha-thinkpad.localdomain> In-Reply-To: <20111014132002.GA1486@stefanha-thinkpad.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] block: unify flush implementations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org On 10/14/2011 03:20 PM, Stefan Hajnoczi wrote: > It's just too tempting to call these functions in contexts where it is > not okay to do so. The bdrv_co_*() functions are all tagged as > coroutine_fn and make it clear that they can yield. Yes, I agree. > We already have an event loop in qemu-img except it's the nested event > loop in synchronous bdrv_*() emulation functions. The nested event loop > is a mini event loop and can't really do things like timers. It would > be nicer to remove it in favor of a single top-level event loop with the > qemu-img code running in a coroutine. Note that the nested event loop cannot go away because of qemu_aio_flush, though. :( Paolo