From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQyvp-00015x-BH for qemu-devel@nongnu.org; Thu, 26 Feb 2015 08:56:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQyvk-0001X7-3I for qemu-devel@nongnu.org; Thu, 26 Feb 2015 08:56:49 -0500 Received: from smtp3.mundo-r.com ([212.51.32.191]:25795 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQyvj-000138-S3 for qemu-devel@nongnu.org; Thu, 26 Feb 2015 08:56:44 -0500 Date: Thu, 26 Feb 2015 14:56:06 +0100 From: Alberto Garcia Message-ID: <20150226135606.GA11033@igalia.com> References: <14cbc4c207ba6451894101aae39d146144a3c6dc.1423842044.git.berto@igalia.com> <54ECACB5.9030406@redhat.com> <20150225105635.GA14590@igalia.com> <54EDE8DE.1000701@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54EDE8DE.1000701@redhat.com> Subject: Re: [Qemu-devel] [PATCH 9/9] throttle: add name of ThrottleGroup to BlockDeviceInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Wed, Feb 25, 2015 at 08:23:10AM -0700, Eric Blake wrote: > How about query-block-throttle, returning an array of dicts. > > => { "execute":"query-block-throttle" } > <= { "return": [ > { "name": "throttle1", "bps_max": 100000, > "nodes": [ "block0", "block1" ] }, > { "name": "throttle2", "iops_max": 10000, > "nodes": [ "block2" ] } > ] } Ok I wrote it, however I have some doubts about what to put exactly in the 'nodes' array. We can just put node names as you suggest, however at the moment not all nodes have a name so we could end up with a list of empty strings. I think the easiest solution in terms of lines of code and simplicity of the return type is this one: { 'type': 'ThrottleGroupInfo', 'data': { 'name': 'str', 'nodes': ['BlockDeviceInfo'] } } { 'command': 'query-block-throttle', 'returns': ['ThrottleGroupInfo'] } All the information is there, the code to fill the BlockDeviceInfo structure is already written so I can just make use of it. The throttling settings themselves are not present in ThrottleGroupInfo, but since all nodes from a group have the same settings, you can get them from any of them. It also keeps the ThrottleGroupInfo structure simpler. What do you think? If you're ok with this solution I can submit the patch series again. Berto