diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-01-18 20:25:40 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-15 16:11:50 +0200 |
commit | 18bb69287ea522ab696e1bea818b93e5eaa85745 (patch) | |
tree | 881877ce730553c75abcf6bf5a2aa50870993874 /include | |
parent | f05fee508f538ca262d2ab19bcd8772196efe848 (diff) | |
download | qemu-18bb69287ea522ab696e1bea818b93e5eaa85745.zip qemu-18bb69287ea522ab696e1bea818b93e5eaa85745.tar.gz qemu-18bb69287ea522ab696e1bea818b93e5eaa85745.tar.bz2 |
blockjob: Implement block_job_set_speed() centrally
All block job drivers support .set_speed and all of them duplicate the
same code to implement it. Move that code to blockjob.c and remove the
now useless callback.
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')
-rw-r--r-- | include/block/blockjob.h | 2 | ||||
-rw-r--r-- | include/block/blockjob_int.h | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 22bf418..82f52f4 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -29,6 +29,8 @@ #include "block/block.h" #include "qemu/ratelimit.h" +#define BLOCK_JOB_SLICE_TIME 100000000ULL /* ns */ + typedef struct BlockJobDriver BlockJobDriver; typedef struct BlockJobTxn BlockJobTxn; diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index d5a515d..ad510d5 100644 --- a/include/block/blockjob_int.h +++ b/include/block/blockjob_int.h @@ -41,9 +41,6 @@ struct BlockJobDriver { /** String describing the operation, part of query-block-jobs QMP API */ BlockJobType job_type; - /** Optional callback for job types that support setting a speed limit */ - void (*set_speed)(BlockJob *job, int64_t speed, Error **errp); - /** Mandatory: Entrypoint for the Coroutine. */ CoroutineEntry *start; |