From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF1QE-00083H-I9 for qemu-devel@nongnu.org; Thu, 29 Aug 2013 08:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF1Q5-0003ZD-TI for qemu-devel@nongnu.org; Thu, 29 Aug 2013 08:33:58 -0400 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:34244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF1Q5-0003Yp-Ku for qemu-devel@nongnu.org; Thu, 29 Aug 2013 08:33:49 -0400 Received: by mail-ea0-f182.google.com with SMTP id o10so206402eaj.41 for ; Thu, 29 Aug 2013 05:33:48 -0700 (PDT) Date: Thu, 29 Aug 2013 14:33:45 +0200 From: Stefan Hajnoczi Message-ID: <20130829123345.GC17744@stefanha-thinkpad.redhat.com> References: <1376070245-22557-1-git-send-email-charlie@ctshepherd.com> <1376070245-22557-5-git-send-email-charlie@ctshepherd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1376070245-22557-5-git-send-email-charlie@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 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. Stefan