aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2017-07-02 13:06:45 +0300
committerKevin Wolf <kwolf@redhat.com>2017-07-18 15:14:35 +0200
commitdbe824cc57fbc93dc7ee53287e06c101b20e078b (patch)
tree24b3ee1bec73ec405e02a26a4631603d67740cd3 /util
parentb1e1fa0c3afc7f671fbc24645bdf67949a5657e5 (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')
-rw-r--r--util/throttle.c4
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]);