@@ -946,7 +946,6 @@ static int coroutine_fn mirror_run(Job *job, Error **errp)
while (!job_cancel_requested(&s->common.job) && !s->should_complete) {
job_yield(&s->common.job);
}
- s->common.job.cancelled = false;
goto immediate_exit;
}
@@ -1085,7 +1084,6 @@ static int coroutine_fn mirror_run(Job *job, Error **errp)
* completion.
*/
assert(QLIST_EMPTY(&bs->tracked_requests));
- s->common.job.cancelled = false;
need_drain = false;
break;
}
@@ -217,7 +217,9 @@ const char *job_type_str(const Job *job)
bool job_is_cancelled(Job *job)
{
- return job->cancelled && job->force_cancel;
+ /* force_cancel may be true only if cancelled is true, too */
+ assert(job->cancelled || !job->force_cancel);
+ return job->force_cancel;
}
bool job_cancel_requested(Job *job)