mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
job: Replace BlockJob.completed with job_is_completed()
Since we introduced an explicit status to block job, BlockJob.completed is redundant because it can be derived from the status. Remove the field from BlockJob and add a function to derive it from the status at the Job level. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
b15de82867
commit
dbe5e6c1f7
5 changed files with 34 additions and 14 deletions
|
@ -866,9 +866,9 @@ static void run_block_job(BlockJob *job, Error **errp)
|
|||
aio_poll(aio_context, true);
|
||||
qemu_progress_print(job->len ?
|
||||
((float)job->offset / job->len * 100.f) : 0.0f, 0);
|
||||
} while (!job->ready && !job->completed);
|
||||
} while (!job->ready && !job_is_completed(&job->job));
|
||||
|
||||
if (!job->completed) {
|
||||
if (!job_is_completed(&job->job)) {
|
||||
ret = block_job_complete_sync(job, errp);
|
||||
} else {
|
||||
ret = job->ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue