From: Fam Zheng Date: Tue, 11 Apr 2017 11:43:52 +0000 (+0800) Subject: sheepdog: Use bdrv_coroutine_enter before BDRV_POLL_WHILE X-Git-Tag: v2.9.0-rc4~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76296dff97864ebb15fa65cc56a6f890ee0c5a28;p=thirdparty%2Fqemu.git sheepdog: Use bdrv_coroutine_enter before BDRV_POLL_WHILE When called from main thread, the coroutine should run in the context of bs. Use bdrv_coroutine_enter to ensure that. Signed-off-by: Fam Zheng --- diff --git a/block/sheepdog.c b/block/sheepdog.c index 1b71fc81ec4..14d63272093 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -736,7 +736,7 @@ static int do_req(int sockfd, BlockDriverState *bs, SheepdogReq *hdr, } else { co = qemu_coroutine_create(do_co_req, &srco); if (bs) { - qemu_coroutine_enter(co); + bdrv_coroutine_enter(bs, co); BDRV_POLL_WHILE(bs, !srco.finished); } else { qemu_coroutine_enter(co);