提交 aaa1e77f 编写于 作者: A Alberto Garcia 提交者: Stefan Hajnoczi

throttle: Don't allow burst limits to be lower than the normal limits

Setting FOO_max to a value that is lower than FOO does not make
sense, and it produces odd results depending on the value of
FOO_max_length. Although the user should not set that configuration
in the first place it's better to reject it explicitly.

https://bugzilla.redhat.com/show_bug.cgi?id=1355665Signed-off-by: NAlberto Garcia <berto@igalia.com>
Reported-by: NGu Nini <ngu@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-id: 663d5aca406060e31f80d8113f77b6feee63b919.1469693110.git.berto@igalia.com
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 555a608c
......@@ -348,6 +348,11 @@ bool throttle_is_valid(ThrottleConfig *cfg, Error **errp)
" bps/iops values");
return false;
}
if (cfg->buckets[i].max && cfg->buckets[i].max < cfg->buckets[i].avg) {
error_setg(errp, "bps_max/iops_max cannot be lower than bps/iops");
return false;
}
}
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册