From 27e4cf13030ca5d12bbad12f38a27d35378a5894 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 2 Jul 2017 13:06:46 +0300 Subject: 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 Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/throttle-groups.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'block') diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 71af3f7..890bfde 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -426,18 +426,10 @@ void throttle_group_restart_blk(BlockBackend *blk) void throttle_group_config(BlockBackend *blk, ThrottleConfig *cfg) { BlockBackendPublic *blkp = blk_get_public(blk); - ThrottleTimers *tt = &blkp->throttle_timers; ThrottleState *ts = blkp->throttle_state; ThrottleGroup *tg = container_of(ts, ThrottleGroup, ts); qemu_mutex_lock(&tg->lock); - /* throttle_config() cancels the timers */ - if (timer_pending(tt->timers[0])) { - tg->any_timer_armed[0] = false; - } - if (timer_pending(tt->timers[1])) { - tg->any_timer_armed[1] = false; - } - throttle_config(ts, tg->clock_type, tt, cfg); + throttle_config(ts, tg->clock_type, cfg); qemu_mutex_unlock(&tg->lock); throttle_group_restart_blk(blk); -- cgit v1.1