From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHBR1-0002sP-7p for qemu-devel@nongnu.org; Wed, 04 Sep 2013 07:39:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHBQp-0005jl-4Y for qemu-devel@nongnu.org; Wed, 04 Sep 2013 07:39:43 -0400 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:44180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHBQo-0005jT-Tw for qemu-devel@nongnu.org; Wed, 04 Sep 2013 07:39:31 -0400 Received: by mail-ea0-f170.google.com with SMTP id h14so109457eak.29 for ; Wed, 04 Sep 2013 04:39:30 -0700 (PDT) Date: Wed, 4 Sep 2013 13:39:27 +0200 From: Stefan Hajnoczi Message-ID: <20130904113927.GA12733@stefanha-thinkpad.redhat.com> 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> <521F41D6.6050204@ctshepherd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <521F41D6.6050204@ctshepherd.com> 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: Charlie Shepherd Cc: kwolf@redhat.com, pbonzini@redhat.com, gabriel@kerneis.info, qemu-devel@nongnu.org On Thu, Aug 29, 2013 at 01:43:02PM +0100, Charlie Shepherd wrote: > 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? For .bdrv_*() functions, yes. In other cases the trade-off may be worth it. Stefan