From f05fee508f538ca262d2ab19bcd8772196efe848 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 18 Jan 2018 20:20:24 +0100 Subject: 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 Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: John Snow --- include/block/blockjob.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/block') 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; -- cgit v1.2.3