From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF1ZA-0006UJ-6I for qemu-devel@nongnu.org; Thu, 29 Aug 2013 08:43:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF1Z2-00077A-9f for qemu-devel@nongnu.org; Thu, 29 Aug 2013 08:43:12 -0400 Received: from mail6.webfaction.com ([74.55.86.74]:57660 helo=smtp.webfaction.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF1Z2-00075c-4I for qemu-devel@nongnu.org; Thu, 29 Aug 2013 08:43:04 -0400 Message-ID: <521F41D6.6050204@ctshepherd.com> Date: Thu, 29 Aug 2013 13:43:02 +0100 From: Charlie Shepherd MIME-Version: 1.0 References: <1376070245-22557-1-git-send-email-charlie@ctshepherd.com> <1376070245-22557-5-git-send-email-charlie@ctshepherd.com> <20130829123345.GC17744@stefanha-thinkpad.redhat.com> In-Reply-To: <20130829123345.GC17744@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 05/15] Make qcow2_open synchronous List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, pbonzini@redhat.com, gabriel@kerneis.info, qemu-devel@nongnu.org On 29/08/2013 13:33, Stefan Hajnoczi wrote: > On Fri, Aug 09, 2013 at 07:43:55PM +0200, Charlie Shepherd wrote: >> The previous patch convert all .bdrv_open functions to run from a coroutine context. However >> qcow2's open method is also called from qcow2_invalidate_cache. bdrv_invalidate_cache is mainly >> called by migration.c, which doesn't run in coroutine context, so rather than propagating >> coroutine_fn annotations up the call chain, turn qcow2_open into a synchronous wrapper. > I think it would be cleaner to make .bdrv_open a coroutine function and > push the synchronous wrapper out to the callers. That way we can either > keep synchronous wrappers where necessary, or we can eventually convert > that synchronous code to coroutine code. > > If you hide the synchronous wrapper inside qcow2 it blocks coroutine > callers who could otherwise use the event loop. So you want this approach for all synchronous wrappers? Charlie