aboutsummaryrefslogtreecommitdiff
path: root/util/throttle.c
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2017-07-02 13:06:46 +0300
committerKevin Wolf <kwolf@redhat.com>2017-07-18 15:14:35 +0200
commit27e4cf13030ca5d12bbad12f38a27d35378a5894 (patch)
treed4b44b55555db9f98fb3446c74a53593feeb09f5 /util/throttle.c
parentdbe824cc57fbc93dc7ee53287e06c101b20e078b (diff)
downloadqemu-27e4cf13030ca5d12bbad12f38a27d35378a5894.zip
qemu-27e4cf13030ca5d12bbad12f38a27d35378a5894.tar.gz
qemu-27e4cf13030ca5d12bbad12f38a27d35378a5894.tar.bz2
block: remove timer canceling in throttle_config()
throttle_config() cancels the timers of the calling BlockBackend. This doesn't make sense because other BlockBackends in the group remain untouched. There's no need to cancel the timers in the one specific BlockBackend so let's not do that. Throttled requests will run as scheduled and future requests will follow the new configuration. This also allows a throttle group's configuration to be changed even when it has no members. 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.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/util/throttle.c b/util/throttle.c
index 3e94807..b2a52b8 100644
--- a/util/throttle.c
+++ b/util/throttle.c
@@ -388,24 +388,14 @@ static void throttle_unfix_bucket(LeakyBucket *bkt)
}
}
-/* take care of canceling a timer */
-static void throttle_cancel_timer(QEMUTimer *timer)
-{
- assert(timer != NULL);
-
- timer_del(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)
{
int i;
@@ -417,10 +407,6 @@ void throttle_config(ThrottleState *ts,
}
ts->previous_leak = qemu_clock_get_ns(clock_type);
-
- for (i = 0; i < 2; i++) {
- throttle_cancel_timer(tt->timers[i]);
- }
}
/* used to get config