aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-19 13:04:01 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:50 +0200
commitdbe5e6c1f73b41282624b78a2375a5c3ee59e905 (patch)
treeec2cad34f5b7d8a067166b251ab7743c86a595a1 /qemu-img.c
parentb15de82867975e0b4acf644b5ee36d84904b6612 (diff)
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>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 911456ba40..f3fe903c38 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -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;