[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.7 1/2] throttle: Don't allow burst limits
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.7 1/2] throttle: Don't allow burst limits to be lower than the normal limits |
Date: |
Wed, 27 Jul 2016 16:33:51 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 07/27/2016 04:16 PM, Alberto Garcia wrote:
> 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=1355665
>
> Signed-off-by: Alberto Garcia <address@hidden>
> Reported-by: Gu Nini <address@hidden>
> ---
> util/throttle.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/util/throttle.c b/util/throttle.c
> index 654f95c..7a5c619 100644
> --- a/util/throttle.c
> +++ b/util/throttle.c
> @@ -348,6 +348,12 @@ 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, "if bps_max/iops_max is set it cannot be lower"
> + " than the bps/iops values");
Feels a bit long, I'd be fine with "bps_max/iops_max must not be lower
than bps/iops values". But the idea makes sense.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature