diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-01-18 20:20:24 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-15 16:11:50 +0200 |
commit | f05fee508f538ca262d2ab19bcd8772196efe848 (patch) | |
tree | 03c8ecc8f7783131226f927d62dcff6a060b6a20 /include/block | |
parent | 05df8a6a2b4e36e8d69de2130e616d5ac28e8837 (diff) |
blockjob: Move RateLimit to BlockJob
Every block job has a RateLimit, and they all do the exact same thing
with it, so it should be common infrastructure. Move the struct field
for a start.
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')
-rw-r--r-- | include/block/blockjob.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index a2cc52233b..22bf418209 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -27,6 +27,7 @@ #define BLOCKJOB_H #include "block/block.h" +#include "qemu/ratelimit.h" typedef struct BlockJobDriver BlockJobDriver; typedef struct BlockJobTxn BlockJobTxn; @@ -118,6 +119,9 @@ typedef struct BlockJob { /** Speed that was set with @block_job_set_speed. */ int64_t speed; + /** Rate limiting data structure for implementing @speed. */ + RateLimit limit; + /** The completion function that will be called when the job completes. */ BlockCompletionFunc *cb; |