mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
blockjob: Introduce block_job_ratelimit_get_delay()
This gets us rid of more direct accesses to BlockJob fields from the job drivers. 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>
This commit is contained in:
@ -197,8 +197,8 @@ static void coroutine_fn commit_run(void *opaque)
|
||||
/* Publish progress */
|
||||
block_job_progress_update(&s->common, n);
|
||||
|
||||
if (copy && s->common.speed) {
|
||||
delay_ns = ratelimit_calculate_delay(&s->common.limit, n);
|
||||
if (copy) {
|
||||
delay_ns = block_job_ratelimit_get_delay(&s->common, n);
|
||||
} else {
|
||||
delay_ns = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user