diff options
author | Kevin Wolf | 2018-01-18 18:08:22 +0100 |
---|---|---|
committer | Kevin Wolf | 2018-05-15 16:11:49 +0200 |
commit | 05df8a6a2b4e36e8d69de2130e616d5ac28e8837 (patch) | |
tree | 69a1ee332e3b77767f2df4ced3066b08e9baae7b /include/block/blockjob.h | |
parent | blockjob: Fix assertion in block_job_finalize() (diff) | |
download | qemu-05df8a6a2b4e36e8d69de2130e616d5ac28e8837.tar.gz qemu-05df8a6a2b4e36e8d69de2130e616d5ac28e8837.tar.xz qemu-05df8a6a2b4e36e8d69de2130e616d5ac28e8837.zip |
blockjob: Wrappers for progress counter access
Block job drivers are not expected to mess with the internals of the
BlockJob object, so provide wrapper functions for one of the cases where
they still do it: Updating the progress counter.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'include/block/blockjob.h')
-rw-r--r-- | include/block/blockjob.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index fc645dac68..a2cc52233b 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -278,6 +278,25 @@ void block_job_finalize(BlockJob *job, Error **errp); void block_job_dismiss(BlockJob **job, Error **errp); /** + * block_job_progress_update: + * @job: The job that has made progress + * @done: How much progress the job made + * + * Updates the progress counter of the job. + */ +void block_job_progress_update(BlockJob *job, uint64_t done); + +/** + * block_job_progress_set_remaining: + * @job: The job whose expected progress end value is set + * @remaining: Expected end value of the progress counter of the job + * + * Sets the expected end value of the progress counter of a job so that a + * completion percentage can be calculated when the progress is updated. + */ +void block_job_progress_set_remaining(BlockJob *job, uint64_t remaining); + +/** * block_job_query: * @job: The job to get information about. * |