mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
job: Move progress fields to Job
BlockJob has fields .offset and .len, which are actually misnomers today because they are no longer tied to block device sizes, but just progress counters. As such they make a lot of sense in generic Jobs. This patch moves the fields to Job and renames them to .progress_current and .progress_total to describe their function better. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
2e1795b581
commit
30a5c887bf
9 changed files with 62 additions and 55 deletions
|
@ -52,12 +52,6 @@ typedef struct BlockJob {
|
|||
/** Status that is published by the query-block-jobs QMP API */
|
||||
BlockDeviceIoStatus iostatus;
|
||||
|
||||
/** Offset that is published by the query-block-jobs QMP API */
|
||||
int64_t offset;
|
||||
|
||||
/** Length that is published by the query-block-jobs QMP API */
|
||||
int64_t len;
|
||||
|
||||
/** Speed that was set with @block_job_set_speed. */
|
||||
int64_t speed;
|
||||
|
||||
|
@ -138,25 +132,6 @@ void block_job_remove_all_bdrv(BlockJob *job);
|
|||
*/
|
||||
void block_job_set_speed(BlockJob *job, int64_t speed, 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue