qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 2/2] throttle: make throttle_config(throttle_


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH v2 2/2] throttle: make throttle_config(throttle_get_config()) symmetric
Date: Wed, 1 Mar 2017 10:44:15 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Tue, Feb 28, 2017 at 01:17:55PM +0100, Alberto Garcia wrote:
> On Tue 28 Feb 2017 12:19:35 PM CET, Stefan Hajnoczi wrote:
> > +/* undo internal bucket parameter changes (see throttle_fix_bucket()) */
> > +static void throttle_unfix_bucket(LeakyBucket *bkt)
> > +{
> > +    double min = bkt->avg / 10;
> > +
> > +    if (bkt->max == min) {
> > +        bkt->max = 0;
> > +    }
> > +}
> 
> I guess you could do the more general if (bkt->max < bkt->avg), but your
> solution is also fine with me.
> 
> Reviewed-by: Alberto Garcia <address@hidden>

I did that originally because I try to avoid floating-point equality.
The test case uses an invalid setting though (->max = 1, ->avg = 56)
which would be rejected if given on the command-line.

Thinking about this again, it's probably better to modify the test case
and use max < avg.

Will send a v3.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]