From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiS6t-0000u9-AT for qemu-devel@nongnu.org; Tue, 22 Mar 2016 15:37:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiS6p-0003E1-GJ for qemu-devel@nongnu.org; Tue, 22 Mar 2016 15:36:59 -0400 From: Kevin Wolf Date: Tue, 22 Mar 2016 20:36:36 +0100 Message-Id: <1458675397-24956-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1458675397-24956-1-git-send-email-kwolf@redhat.com> References: <1458675397-24956-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 8/9] block: Don't return throttling info in query-named-block-nodes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com 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 --- block/qapi.c | 6 +++--- tests/qemu-iotests/096 | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 0a222f6..d167e67 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -66,10 +66,10 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk, info->backing_file_depth = bdrv_get_backing_file_depth(bs); 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; - throttle_group_get_config(bs->blk, &cfg); + throttle_group_get_config(blk, &cfg); info->bps = cfg.buckets[THROTTLE_BPS_TOTAL].avg; info->bps_rd = cfg.buckets[THROTTLE_BPS_READ].avg; @@ -117,7 +117,7 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk, info->iops_size = cfg.op_size; 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); diff --git a/tests/qemu-iotests/096 b/tests/qemu-iotests/096 index e34204b..aeeb375 100644 --- a/tests/qemu-iotests/096 +++ b/tests/qemu-iotests/096 @@ -45,8 +45,9 @@ class TestLiveSnapshot(iotests.QMPTestCase): os.remove(self.target_img) def checkConfig(self, active_layer): - result = self.vm.qmp('query-named-block-nodes') + result = self.vm.qmp('query-block') for r in result['return']: + r = r['inserted'] if r['node-name'] == active_layer: self.assertEqual(r['group'], self.group) self.assertEqual(r['iops'], self.iops) -- 1.8.3.1