diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-08-14 15:51:24 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-08-14 15:51:24 +0100 |
commit | 8e0adf64140ab93aba79be2f0227a47eda78e464 (patch) | |
tree | f9de7df220b45ac9eb8dd8c2390dad874728b175 /util | |
parent | be1f13ac9d9fc21908975460652a72f5f0c018c5 (diff) | |
parent | 92e11a17612108b1729bde4ce61aad0cc1ce5889 (diff) | |
download | qemu-8e0adf64140ab93aba79be2f0227a47eda78e464.zip qemu-8e0adf64140ab93aba79be2f0227a47eda78e464.tar.gz qemu-8e0adf64140ab93aba79be2f0227a47eda78e464.tar.bz2 |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Fri 14 Aug 2015 15:41:14 BST using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
* remotes/stefanha/tags/block-pull-request:
throttle: add throttle_max_is_missing_limit() test
throttle: refuse bps_max/iops_max without bps/iops
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/throttle.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/util/throttle.c b/util/throttle.c index 706c131..1113671 100644 --- a/util/throttle.c +++ b/util/throttle.c @@ -300,6 +300,21 @@ bool throttle_is_valid(ThrottleConfig *cfg) return !invalid; } +/* check if bps_max/iops_max is used without bps/iops + * @cfg: the throttling configuration to inspect + */ +bool throttle_max_is_missing_limit(ThrottleConfig *cfg) +{ + int i; + + for (i = 0; i < BUCKETS_COUNT; i++) { + if (cfg->buckets[i].max && !cfg->buckets[i].avg) { + return true; + } + } + return false; +} + /* fix bucket parameters */ static void throttle_fix_bucket(LeakyBucket *bkt) { |