Skip to content

Commit

Permalink
blockjob: move iostatus reset out of block_job_enter()
Browse files Browse the repository at this point in the history
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: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1466096189-6477-2-git-send-email-stefanha@redhat.com
  • Loading branch information
stefanhaRH committed Jun 20, 2016
1 parent ec050f7 commit 17bd51f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions blockdev.c
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion blockjob.c
Expand Up @@ -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);
}
Expand All @@ -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);
}

Expand Down

0 comments on commit 17bd51f

Please sign in to comment.