Received: from eggs.gnu.org ([2001:4830:134:3::10]:35473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cigjB-0000hm-5F for qemu-devel@nongnu.org; Tue, 28 Feb 2017 07:18:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cigj7-0001Kb-Vd for qemu-devel@nongnu.org; Tue, 28 Feb 2017 07:18:01 -0500 From: Alberto Garcia In-Reply-To: <20170228111935.10826-3-stefanha@redhat.com> References: <20170228111935.10826-1-stefanha@redhat.com> <20170228111935.10826-3-stefanha@redhat.com> Date: Tue, 28 Feb 2017 13:17:55 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 2/2] throttle: make throttle_config(throttle_get_config()) symmetric List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Nini Gu , qemu-block@nongnu.org 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 Berto