Skip to content

Commit aef4278

Browse files
author
Fam Zheng
committed
blockjob: Use bdrv_coroutine_enter to start coroutine
Resuming and especially starting of the block job coroutine, could be issued in the main thread. However the coroutine's "home" ctx should be set to the same context as job->blk. Use bdrv_coroutine_enter to ensure that. Signed-off-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
1 parent 052a757 commit aef4278

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

blockjob.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void block_job_start(BlockJob *job)
290290
job->pause_count--;
291291
job->busy = true;
292292
job->paused = false;
293-
qemu_coroutine_enter(job->co);
293+
bdrv_coroutine_enter(blk_bs(job->blk), job->co);
294294
}
295295

296296
void block_job_ref(BlockJob *job)
@@ -532,7 +532,7 @@ void block_job_user_resume(BlockJob *job)
532532
void block_job_enter(BlockJob *job)
533533
{
534534
if (job->co && !job->busy) {
535-
qemu_coroutine_enter(job->co);
535+
bdrv_coroutine_enter(blk_bs(job->blk), job->co);
536536
}
537537
}
538538

0 commit comments

Comments
 (0)