From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Gtk-0006Vk-Iy for qemu-devel@nongnu.org; Wed, 16 Dec 2015 13:34:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9Gtg-0005y1-OF for qemu-devel@nongnu.org; Wed, 16 Dec 2015 13:34:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Gtg-0005xp-Ix for qemu-devel@nongnu.org; Wed, 16 Dec 2015 13:33:56 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 400F833E7D3 for ; Wed, 16 Dec 2015 18:33:56 +0000 (UTC) From: Paolo Bonzini Date: Wed, 16 Dec 2015 19:33:47 +0100 Message-Id: <1450290827-30508-5-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com When called from a coroutine, bdrv_ioctl must be asynchronous just like e.g. bdrv_flush. The code was incorrectly making it synchronous, fix it. Signed-off-by: Paolo Bonzini --- Fam, any reason why you did it this way? I don't see any coroutine caller, but it doesn't make much sense. :) block/io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/io.c b/block/io.c index e00fb5d..841f5b5 100644 --- a/block/io.c +++ b/block/io.c @@ -2614,10 +2614,11 @@ int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) bdrv_co_ioctl_entry(&data); } else { Coroutine *co = qemu_coroutine_create(bdrv_co_ioctl_entry); + qemu_coroutine_enter(co, &data); - } - while (data.ret == -EINPROGRESS) { - aio_poll(bdrv_get_aio_context(bs), true); + while (data.ret == -EINPROGRESS) { + aio_poll(bdrv_get_aio_context(bs), true); + } } return data.ret; } -- 2.5.0