mirror of https://github.com/xqemu/xqemu.git
block: Don't return throttling info in query-named-block-nodes
query-named-block-nodes should not return information that is related to the attached BlockBackend rather than the node itself, so throttling information needs to be removed from it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
7c8eece45b
commit
79c719b755
|
@ -67,10 +67,10 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
|
||||||
info->backing_file_depth = bdrv_get_backing_file_depth(bs);
|
info->backing_file_depth = bdrv_get_backing_file_depth(bs);
|
||||||
info->detect_zeroes = bs->detect_zeroes;
|
info->detect_zeroes = bs->detect_zeroes;
|
||||||
|
|
||||||
if (bs->blk && blk_get_public(bs->blk)->throttle_state) {
|
if (blk && blk_get_public(blk)->throttle_state) {
|
||||||
ThrottleConfig cfg;
|
ThrottleConfig cfg;
|
||||||
|
|
||||||
throttle_group_get_config(bs->blk, &cfg);
|
throttle_group_get_config(blk, &cfg);
|
||||||
|
|
||||||
info->bps = cfg.buckets[THROTTLE_BPS_TOTAL].avg;
|
info->bps = cfg.buckets[THROTTLE_BPS_TOTAL].avg;
|
||||||
info->bps_rd = cfg.buckets[THROTTLE_BPS_READ].avg;
|
info->bps_rd = cfg.buckets[THROTTLE_BPS_READ].avg;
|
||||||
|
@ -118,7 +118,7 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
|
||||||
info->iops_size = cfg.op_size;
|
info->iops_size = cfg.op_size;
|
||||||
|
|
||||||
info->has_group = true;
|
info->has_group = true;
|
||||||
info->group = g_strdup(throttle_group_get_name(bs->blk));
|
info->group = g_strdup(throttle_group_get_name(blk));
|
||||||
}
|
}
|
||||||
|
|
||||||
info->write_threshold = bdrv_write_threshold_get(bs);
|
info->write_threshold = bdrv_write_threshold_get(bs);
|
||||||
|
|
|
@ -45,8 +45,9 @@ class TestLiveSnapshot(iotests.QMPTestCase):
|
||||||
os.remove(self.target_img)
|
os.remove(self.target_img)
|
||||||
|
|
||||||
def checkConfig(self, active_layer):
|
def checkConfig(self, active_layer):
|
||||||
result = self.vm.qmp('query-named-block-nodes')
|
result = self.vm.qmp('query-block')
|
||||||
for r in result['return']:
|
for r in result['return']:
|
||||||
|
r = r['inserted']
|
||||||
if r['node-name'] == active_layer:
|
if r['node-name'] == active_layer:
|
||||||
self.assertEqual(r['group'], self.group)
|
self.assertEqual(r['group'], self.group)
|
||||||
self.assertEqual(r['iops'], self.iops)
|
self.assertEqual(r['iops'], self.iops)
|
||||||
|
|
Loading…
Reference in New Issue