From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Y29-0002gd-Nr for qemu-devel@nongnu.org; Thu, 17 Dec 2015 07:51:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9Y25-0005YS-IH for qemu-devel@nongnu.org; Thu, 17 Dec 2015 07:51:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Y25-0005YJ-Cz for qemu-devel@nongnu.org; Thu, 17 Dec 2015 07:51:45 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 04449D69D3 for ; Thu, 17 Dec 2015 12:51:45 +0000 (UTC) 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> From: Paolo Bonzini Message-ID: <5672AFDE.3030207@redhat.com> Date: Thu, 17 Dec 2015 13:51:42 +0100 MIME-Version: 1.0 In-Reply-To: <20151217123306.GB26335@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Fam Zheng Cc: qemu-devel@nongnu.org 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. Paolo