提交 17bd51f9 编写于 作者: S Stefan Hajnoczi

blockjob: move iostatus reset out of block_job_enter()

The QMP block-job-resume command and cancellation may want to reset the
job's iostatus.  The next patches add a user who does not want to reset
iostatus so move it up to block_job_enter() callers.
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NFam Zheng <famz@redhat.com>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-id: 1466096189-6477-2-git-send-email-stefanha@redhat.com
上级 ec050f77
......@@ -3811,6 +3811,7 @@ void qmp_block_job_resume(const char *device, Error **errp)
job->user_paused = false;
trace_qmp_block_job_resume(job);
block_job_iostatus_reset(job);
block_job_resume(job);
aio_context_release(aio_context);
}
......
......@@ -269,7 +269,6 @@ void block_job_resume(BlockJob *job)
void block_job_enter(BlockJob *job)
{
block_job_iostatus_reset(job);
if (job->co && !job->busy) {
qemu_coroutine_enter(job->co, NULL);
}
......@@ -278,6 +277,7 @@ void block_job_enter(BlockJob *job)
void block_job_cancel(BlockJob *job)
{
job->cancelled = true;
block_job_iostatus_reset(job);
block_job_enter(job);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册