Commit a689dbf2 authored by Fam Zheng's avatar Fam Zheng Committed by Kevin Wolf
Browse files

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



They are set when block_job_completed is called.

Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
Message-id: 1446765200-3054-8-git-send-email-jsnow@redhat.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 57901ecb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
}
+9 −0
Original line number Diff line number Diff line
@@ -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;

};

/**