diff options
author | Alberto Garcia <berto@igalia.com> | 2017-08-24 16:24:47 +0300 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-08-29 16:54:45 +0100 |
commit | d00e6923b1e2c1bec7840b0a0706764493648527 (patch) | |
tree | 69eeea23ae67f21975a6f763b762eff404923189 /include/qemu | |
parent | 2a8be39ebad013e506e31b069ddcce8993a957bf (diff) | |
download | qemu-d00e6923b1e2c1bec7840b0a0706764493648527.zip qemu-d00e6923b1e2c1bec7840b0a0706764493648527.tar.gz qemu-d00e6923b1e2c1bec7840b0a0706764493648527.tar.bz2 |
throttle: Make LeakyBucket.avg and LeakyBucket.max integer types
Both the throttling limits set with the throttling.iops-* and
throttling.bps-* options and their QMP equivalents defined in the
BlockIOThrottle struct are integer values.
Those limits are also reported in the BlockDeviceInfo struct and they
are integers there as well.
Therefore there's no reason to store them internally as double and do
the conversion everytime we're setting or querying them, so this patch
uses uint64_t for those types. Let's also use an unsigned type because
we don't allow negative values anyway.
LeakyBucket.level and LeakyBucket.burst_level do however remain double
because their value changes depending on the fraction of time elapsed
since the previous I/O operation.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: f29b840422767b5be2c41c2dfdbbbf6c5f8fedf8.1503580370.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r-- | include/qemu/throttle.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index 66a8ac1..6e31155 100644 --- a/include/qemu/throttle.h +++ b/include/qemu/throttle.h @@ -77,8 +77,8 @@ typedef enum { */ typedef struct LeakyBucket { - double avg; /* average goal in units per second */ - double max; /* leaky bucket max burst in units */ + uint64_t avg; /* average goal in units per second */ + uint64_t max; /* leaky bucket max burst in units */ double level; /* bucket level in units */ double burst_level; /* bucket level in units (for computing bursts) */ unsigned burst_length; /* max length of the burst period, in seconds */ |