Stefan Hajnoczi d72915c60b 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 <ngu@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20170301115026.22621-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-04-21 10:36:12 +01:00
..
2017-03-01 11:58:57 +04:00
2017-03-03 10:09:03 +00:00
2017-03-01 11:51:28 +04:00
2017-03-01 11:51:28 +04:00
2017-03-01 11:51:05 +04:00
2017-03-01 11:51:04 +04:00
2017-03-01 11:51:28 +04:00
2017-03-01 11:51:04 +04:00
2017-03-01 11:51:05 +04:00
2017-03-01 11:51:05 +04:00
2017-03-01 00:09:28 +04:00
2017-03-01 00:09:28 +04:00
2017-03-01 00:09:28 +04:00
2017-03-01 00:09:28 +04:00
2017-03-01 11:50:33 +04:00
2017-03-01 11:51:25 +04:00
2017-01-10 08:49:59 -08:00
2017-02-28 20:47:50 +01:00
2017-03-07 16:07:47 +01:00
2017-03-07 07:32:28 +00:00
2017-03-01 11:51:29 +04:00
2017-03-01 11:51:29 +04:00