mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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:
parent
05df8a6a2b
commit
f05fee508f
5 changed files with 13 additions and 12 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue