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>
This commit is contained in:
Kevin Wolf 2018-01-18 20:20:24 +01:00
parent 05df8a6a2b
commit f05fee508f
5 changed files with 13 additions and 12 deletions

View file

@ -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;