]> Git Repo - qemu.git/commit - tests/test-throttle.c
throttle: make throttle_config(throttle_get_config()) symmetric
authorStefan Hajnoczi <[email protected]>
Wed, 1 Mar 2017 11:50:26 +0000 (11:50 +0000)
committerStefan Hajnoczi <[email protected]>
Fri, 21 Apr 2017 09:36:12 +0000 (10:36 +0100)
commitd72915c60bff51495529449750e051d01b03c62f
treec88c623920e0b81b24afd435adad57c4e65c39d2
parentab08aec45f67a776ea37cee0bf94a34abb84ad97
throttle: make throttle_config(throttle_get_config()) symmetric

Throttling has a weird property that throttle_get_config() does not
always return the same throttling settings that were given with
throttle_config().  In other words, the set and get functions aren't
symmetric.

If .max is 0 then the throttling code assigns a default value of .avg /
10 in throttle_config().  This is an implementation detail of the
throttling algorithm.  When throttle_get_config() is called the .max
value returned should still be 0.

Users are exposed to this quirk via "info block" or "query-block"
monitor commands.  This has caused confusion because it looks like a bug
when an unexpected value is reported.

This patch hides the .max value adjustment in throttle_get_config() and
updates test-throttle.c appropriately.

Reported-by: Nini Gu <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Alberto Garcia <[email protected]>
Message-id: 20170301115026[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
tests/test-throttle.c
util/throttle.c
This page took 0.027026 seconds and 4 git commands to generate.