From cc0681c45430a1f1a4c2d06e9499b7775afc9a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Mon, 2 Sep 2013 14:14:39 +0200 Subject: block: Enable the new throttling code in the block layer. Signed-off-by: Benoit Canet Signed-off-by: Stefan Hajnoczi --- block/qapi.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'block') diff --git a/block/qapi.c b/block/qapi.c index a4bc411..cac3919 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -223,18 +223,15 @@ void bdrv_query_info(BlockDriverState *bs, info->inserted->backing_file_depth = bdrv_get_backing_file_depth(bs); if (bs->io_limits_enabled) { - info->inserted->bps = - bs->io_limits.bps[BLOCK_IO_LIMIT_TOTAL]; - info->inserted->bps_rd = - bs->io_limits.bps[BLOCK_IO_LIMIT_READ]; - info->inserted->bps_wr = - bs->io_limits.bps[BLOCK_IO_LIMIT_WRITE]; - info->inserted->iops = - bs->io_limits.iops[BLOCK_IO_LIMIT_TOTAL]; - info->inserted->iops_rd = - bs->io_limits.iops[BLOCK_IO_LIMIT_READ]; - info->inserted->iops_wr = - bs->io_limits.iops[BLOCK_IO_LIMIT_WRITE]; + ThrottleConfig cfg; + throttle_get_config(&bs->throttle_state, &cfg); + info->inserted->bps = cfg.buckets[THROTTLE_BPS_TOTAL].avg; + info->inserted->bps_rd = cfg.buckets[THROTTLE_BPS_READ].avg; + info->inserted->bps_wr = cfg.buckets[THROTTLE_BPS_WRITE].avg; + + info->inserted->iops = cfg.buckets[THROTTLE_OPS_TOTAL].avg; + info->inserted->iops_rd = cfg.buckets[THROTTLE_OPS_READ].avg; + info->inserted->iops_wr = cfg.buckets[THROTTLE_OPS_WRITE].avg; } bs0 = bs; -- cgit v1.1