aboutsummaryrefslogtreecommitdiff
path: root/blockjob.c
diff options
context:
space:
mode:
Diffstat (limited to 'blockjob.c')
-rw-r--r--blockjob.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/blockjob.c b/blockjob.c
index ae9c5b2..bcd7efc 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -99,6 +99,9 @@ void block_job_completed(BlockJob *job, int ret)
BlockDriverState *bs = job->bs;
assert(bs->job == job);
+ assert(!job->completed);
+ job->completed = true;
+ job->ret = ret;
job->cb(job->opaque, ret);
block_job_unref(job);
}