aboutsummaryrefslogtreecommitdiff
path: root/blockjob.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-04-10 20:12:05 +0800
committerFam Zheng <famz@redhat.com>2017-04-11 20:07:15 +0800
commitaef4278c5a835c555ffe065f9e480190fd076675 (patch)
treea09dc04998de736f6800c1d41e5ee78d75f3374e /blockjob.c
parent052a75721fb38b9aa0e71ea6420b462c0e356e74 (diff)
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>
Diffstat (limited to 'blockjob.c')
-rw-r--r--blockjob.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/blockjob.c b/blockjob.c
index 9b619f385a..6e489327ff 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -290,7 +290,7 @@ void block_job_start(BlockJob *job)
job->pause_count--;
job->busy = true;
job->paused = false;
- qemu_coroutine_enter(job->co);
+ bdrv_coroutine_enter(blk_bs(job->blk), job->co);
}
void block_job_ref(BlockJob *job)
@@ -532,7 +532,7 @@ void block_job_user_resume(BlockJob *job)
void block_job_enter(BlockJob *job)
{
if (job->co && !job->busy) {
- qemu_coroutine_enter(job->co);
+ bdrv_coroutine_enter(blk_bs(job->blk), job->co);
}
}