summaryrefslogtreecommitdiffstats
path: root/blockdev.c
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2016-02-18 12:27:03 +0200
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:45:30 -0600
commitc17cdddf912f05832778e2ae15e5f10e3d2489c1 (patch)
tree2f93886decb9bba183d9142f3c4c316737a8397e /blockdev.c
parent2a96894d9c31a799960b21dcfd1b5e6a3d28581c (diff)
downloadhqemu-c17cdddf912f05832778e2ae15e5f10e3d2489c1.zip
hqemu-c17cdddf912f05832778e2ae15e5f10e3d2489c1.tar.gz
qapi: Add burst length parameters to block_set_io_throttle
This patch adds the new bps_*_max_length and iops_*_max_length parameters to the block_set_io_throttle command. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 4fde17f..5c02a42 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2598,6 +2598,18 @@ void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd,
int64_t iops_rd_max,
bool has_iops_wr_max,
int64_t iops_wr_max,
+ bool has_bps_max_length,
+ int64_t bps_max_length,
+ bool has_bps_rd_max_length,
+ int64_t bps_rd_max_length,
+ bool has_bps_wr_max_length,
+ int64_t bps_wr_max_length,
+ bool has_iops_max_length,
+ int64_t iops_max_length,
+ bool has_iops_rd_max_length,
+ int64_t iops_rd_max_length,
+ bool has_iops_wr_max_length,
+ int64_t iops_wr_max_length,
bool has_iops_size,
int64_t iops_size,
bool has_group,
@@ -2652,6 +2664,25 @@ void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd,
cfg.buckets[THROTTLE_OPS_WRITE].max = iops_wr_max;
}
+ if (has_bps_max_length) {
+ cfg.buckets[THROTTLE_BPS_TOTAL].burst_length = bps_max_length;
+ }
+ if (has_bps_rd_max_length) {
+ cfg.buckets[THROTTLE_BPS_READ].burst_length = bps_rd_max_length;
+ }
+ if (has_bps_wr_max_length) {
+ cfg.buckets[THROTTLE_BPS_WRITE].burst_length = bps_wr_max_length;
+ }
+ if (has_iops_max_length) {
+ cfg.buckets[THROTTLE_OPS_TOTAL].burst_length = iops_max_length;
+ }
+ if (has_iops_rd_max_length) {
+ cfg.buckets[THROTTLE_OPS_READ].burst_length = iops_rd_max_length;
+ }
+ if (has_iops_wr_max_length) {
+ cfg.buckets[THROTTLE_OPS_WRITE].burst_length = iops_wr_max_length;
+ }
+
if (has_iops_size) {
cfg.op_size = iops_size;
}
OpenPOWER on IntegriCloud