From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSr0z-0000x4-Rs for qemu-devel@nongnu.org; Tue, 03 Mar 2015 12:53:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSr0u-0000we-K6 for qemu-devel@nongnu.org; Tue, 03 Mar 2015 12:53:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSr0u-0000wZ-CX for qemu-devel@nongnu.org; Tue, 03 Mar 2015 12:53:48 -0500 Message-ID: <54F5F501.1020802@redhat.com> Date: Tue, 03 Mar 2015 10:53:05 -0700 From: Eric Blake MIME-Version: 1.0 References: <14cbc4c207ba6451894101aae39d146144a3c6dc.1423842044.git.berto@igalia.com> <54ECACB5.9030406@redhat.com> <20150225105635.GA14590@igalia.com> <54EDE8DE.1000701@redhat.com> <20150226135606.GA11033@igalia.com> In-Reply-To: <20150226135606.GA11033@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nAH5rGA05SGduoMtxhBm29K6RPbepOaBf" 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: Alberto Garcia Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nAH5rGA05SGduoMtxhBm29K6RPbepOaBf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/26/2015 06:56 AM, Alberto Garcia wrote: > On Wed, Feb 25, 2015 at 08:23:10AM -0700, Eric Blake wrote: >=20 >> How about query-block-throttle, returning an array of dicts. >> >> =3D> { "execute":"query-block-throttle" } >> <=3D { "return": [ >> { "name": "throttle1", "bps_max": 100000, >> "nodes": [ "block0", "block1" ] }, >> { "name": "throttle2", "iops_max": 10000, >> "nodes": [ "block2" ] } >> ] } >=20 > Ok I wrote it, however I have some doubts about what to put exactly in > the 'nodes' array. >=20 > 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. At one point, we were considering a patch from Jeff Cody that guarantees ALL nodes have a name. Maybe that's still worthwhile. >=20 > I think the easiest solution in terms of lines of code and simplicity > of the return type is this one: >=20 > { 'type': 'ThrottleGroupInfo', > 'data': { 'name': 'str', 'nodes': ['BlockDeviceInfo'] } } That's a bit more verbose, but also a bit more usable (all the block data is available, rather than just a name that has to be looked up via another command), so that could work. >=20 > { 'command': 'query-block-throttle', > 'returns': ['ThrottleGroupInfo'] } >=20 > All the information is there, the code to fill the BlockDeviceInfo > structure is already written so I can just make use of it. >=20 > 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. >=20 > What do you think? If you're ok with this solution I can submit the > patch series again. Sure, sounds like it's worth that solution, since it reused code and made for less work on your part. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --nAH5rGA05SGduoMtxhBm29K6RPbepOaBf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU9fUBAAoJEKeha0olJ0NqImQH/iHJLaHCIM2CMmtfZkr6y0c0 bNHJ0GJY3yDymTvqe0I/hjGILSNRlh5Y514JVKM0LxI+soy0fTAPQrrbdH6793gx s0jB/Nsw0qe97bkNHz+iSQTqNbXcN4KssnZxrlFsmQUPn6zcYwQicaGfgLejH7AE Kglvx7Utl0arX9coWU5tJjU0CetzBOY273oECddWgm7csuSzkQce6SPyAwGMrvgY B5FMzTQsLiiRweLPk67T1yiDCohrVz2X2MJ10qqd3up/zontL2kL4ZttYCJoNnyv EXD1EM+sAB6vo0ZVjeB1p66KGmRl58cGsE1yHmN0BPVoMDi1oYF85+m17j1ZBuI= =d0d0 -----END PGP SIGNATURE----- --nAH5rGA05SGduoMtxhBm29K6RPbepOaBf--