From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9jfe-0007qL-Vh for qemu-devel@nongnu.org; Thu, 17 Dec 2015 20:17:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9jfb-0006H3-QF for qemu-devel@nongnu.org; Thu, 17 Dec 2015 20:17:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9jfb-0006Gm-Ko for qemu-devel@nongnu.org; Thu, 17 Dec 2015 20:17:19 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 8842D8CF73 for ; Fri, 18 Dec 2015 01:17:18 +0000 (UTC) Date: Fri, 18 Dec 2015 09:17:16 +0800 From: Fam Zheng Message-ID: <20151218011716.GE25529@ad.usersys.redhat.com> References: <1450290827-30508-5-git-send-email-pbonzini@redhat.com> <20151217005946.GA20007@ad.usersys.redhat.com> <567275D4.7030605@redhat.com> <20151217123306.GB26335@ad.usersys.redhat.com> <5672AFDE.3030207@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5672AFDE.3030207@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Thu, 12/17 13:51, Paolo Bonzini wrote: > > > On 17/12/2015 13:33, Fam Zheng wrote: > > > In the coroutine case, the yield is hidden in the drivers, and it may or > > > may not happen. For example, qcow2_co_flush_to_os starts with > > > > > > qemu_co_mutex_lock(&s->lock); > > > > > > which can yield. > > > > bdrv_ioctl, on the contrary, is emulated with .bdrv_aio_ioctl, so it always > > yields (unless -ENOTSUP), that's why I think aio_poll() is necessary in both > > branches. > > But why should it yield, if called in coroutine context? bdrv_flush > doesn't yield if emulated with .bdrv_aio_flush *and* called in coroutine > context. bdrv_ioctl should do the same, I think. > Looking at bdrv_flush again I see what you mean. Thanks for explaining! Reviewed-by: Fam Zheng