Skip to content

Commit 17bd51f

Browse files
committed
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: 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
1 parent ec050f7 commit 17bd51f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

blockdev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3811,6 +3811,7 @@ void qmp_block_job_resume(const char *device, Error **errp)
38113811

38123812
job->user_paused = false;
38133813
trace_qmp_block_job_resume(job);
3814+
block_job_iostatus_reset(job);
38143815
block_job_resume(job);
38153816
aio_context_release(aio_context);
38163817
}

blockjob.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ void block_job_resume(BlockJob *job)
269269

270270
void block_job_enter(BlockJob *job)
271271
{
272-
block_job_iostatus_reset(job);
273272
if (job->co && !job->busy) {
274273
qemu_coroutine_enter(job->co, NULL);
275274
}
@@ -278,6 +277,7 @@ void block_job_enter(BlockJob *job)
278277
void block_job_cancel(BlockJob *job)
279278
{
280279
job->cancelled = true;
280+
block_job_iostatus_reset(job);
281281
block_job_enter(job);
282282
}
283283

0 commit comments

Comments
 (0)