提交 a689dbf2 编写于 作者: F Fam Zheng 提交者: Kevin Wolf

blockjob: Add "completed" and "ret" in BlockJob

They are set when block_job_completed is called.
Signed-off-by: NFam Zheng <famz@redhat.com>
Reviewed-by: NJohn Snow <jsnow@redhat.com>
Reviewed-by: NMax Reitz <mreitz@redhat.com>
Signed-off-by: NJohn Snow <jsnow@redhat.com>
Message-id: 1446765200-3054-8-git-send-email-jsnow@redhat.com
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 57901ecb
......@@ -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);
}
......
......@@ -153,6 +153,15 @@ struct BlockJob {
/** Reference count of the block job */
int refcnt;
/* True if this job has reported completion by calling block_job_completed.
*/
bool completed;
/* ret code passed to block_job_completed.
*/
int ret;
};
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册