Received: from eggs.gnu.org ([2001:4830:134:3::10]:47665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF3w0-0000sJ-7R for qemu-devel@nongnu.org; Thu, 29 Aug 2013 11:15:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF3vr-00089R-Q7 for qemu-devel@nongnu.org; Thu, 29 Aug 2013 11:14:56 -0400 Received: from mail-ee0-x22a.google.com ([2a00:1450:4013:c00::22a]:41988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF3vr-000877-J5 for qemu-devel@nongnu.org; Thu, 29 Aug 2013 11:14:47 -0400 Received: by mail-ee0-f42.google.com with SMTP id b45so323360eek.1 for ; Thu, 29 Aug 2013 08:14:46 -0700 (PDT) Date: Thu, 29 Aug 2013 17:14:43 +0200 From: Stefan Hajnoczi Message-ID: <20130829151443.GD17744@stefanha-thinkpad.redhat.com> References: <1376070245-22557-1-git-send-email-charlie@ctshepherd.com> <1376070245-22557-7-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-7-git-send-email-charlie@ctshepherd.com> Subject: Re: [Qemu-devel] [RFC v2 07/15] Call bdrv->open via a synchronous wrapper in block/snapshot.c 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:57PM +0200, Charlie Shepherd wrote: > +static int bdrv_snapshot_open(BlockDriverState *bs) > +{ > + Coroutine *co; > + struct SnapOp so = { > + .bs = bs, > + .ret = NOT_DONE, > + }; > + > + co = qemu_coroutine_create(bdrv_snapshot_open_entry); > + qemu_coroutine_enter(co, &so); > + while (so.ret == NOT_DONE) { > + qemu_aio_wait(); > + } > + > + return so.ret; > +} This is orthogonal to snapshots and should be a generic .bdrv_open() wrapper called block.c:bdrv_open() (the coroutine version should be called bdrv_co_open()).