diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2017-07-02 13:06:45 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-07-18 15:14:35 +0200 |
commit | dbe824cc57fbc93dc7ee53287e06c101b20e078b (patch) | |
tree | 24b3ee1bec73ec405e02a26a4631603d67740cd3 /util/throttle.c | |
parent | b1e1fa0c3afc7f671fbc24645bdf67949a5657e5 (diff) |
block: add clock_type field to ThrottleGroup
Clock type in throttling is currently inferred by the ThrottleTimer's
clock type even though it is a per-ThrottleGroup property; it doesn't
make sense to have different clock types in the same group. Moving this
to a field in ThrottleGroup can simplify some of the throttle functions.
Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'util/throttle.c')
-rw-r--r-- | util/throttle.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/throttle.c b/util/throttle.c index 3570ed25fc..3e948071dd 100644 --- a/util/throttle.c +++ b/util/throttle.c @@ -399,10 +399,12 @@ static void throttle_cancel_timer(QEMUTimer *timer) /* Used to configure the throttle * * @ts: the throttle state we are working on + * @clock_type: the group's clock_type * @tt: the throttle timers we use in this aio context * @cfg: the config to set */ void throttle_config(ThrottleState *ts, + QEMUClockType clock_type, ThrottleTimers *tt, ThrottleConfig *cfg) { @@ -414,7 +416,7 @@ void throttle_config(ThrottleState *ts, throttle_fix_bucket(&ts->cfg.buckets[i]); } - ts->previous_leak = qemu_clock_get_ns(tt->clock_type); + ts->previous_leak = qemu_clock_get_ns(clock_type); for (i = 0; i < 2; i++) { throttle_cancel_timer(tt->timers[i]); |