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 <famz@redhat.com>
This commit is contained in:
Fam Zheng 2017-04-11 19:43:52 +08:00
parent 49ca625913
commit 76296dff97

View File

@ -736,7 +736,7 @@ static int do_req(int sockfd, BlockDriverState *bs, SheepdogReq *hdr,
} else { } else {
co = qemu_coroutine_create(do_co_req, &srco); co = qemu_coroutine_create(do_co_req, &srco);
if (bs) { if (bs) {
qemu_coroutine_enter(co); bdrv_coroutine_enter(bs, co);
BDRV_POLL_WHILE(bs, !srco.finished); BDRV_POLL_WHILE(bs, !srco.finished);
} else { } else {
qemu_coroutine_enter(co); qemu_coroutine_enter(co);