From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYbW1-0006Yt-I1 for qemu-devel@nongnu.org; Thu, 19 Mar 2015 10:33:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYbVx-000122-HY for qemu-devel@nongnu.org; Thu, 19 Mar 2015 10:33:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYbVx-00011v-Ac for qemu-devel@nongnu.org; Thu, 19 Mar 2015 10:33:37 -0400 Message-ID: <550ADE3F.8000102@redhat.com> Date: Thu, 19 Mar 2015 08:33:35 -0600 From: Eric Blake MIME-Version: 1.0 References: <1423623986-590-1-git-send-email-liang.z.li@intel.com> <1423623986-590-13-git-send-email-liang.z.li@intel.com> <87385aqzhm.fsf@blackfin.pond.sub.org> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="87hmlheCEbcd9L9VMKgvMNQtxvCg236FF" Subject: Re: [Qemu-devel] [v5 12/12] migration: Add commands to set and query parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Li, Liang Z" , Markus Armbruster Cc: "quintela@redhat.com" , "qemu-devel@nongnu.org" , "lcapitulino@redhat.com" , "amit.shah@redhat.com" , "Zhang, Yang Z" , "dgilbert@redhat.com" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --87hmlheCEbcd9L9VMKgvMNQtxvCg236FF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/18/2015 08:30 PM, Li, Liang Z wrote: >>> +'migrate-set-parameters', >>> + 'data': { 'parameters': ['MigrationParameterStatus'] } } >> >> The command takes a list of key-value pairs. Looks like this (example= stolen >> from your patch to qmp-commands.hx): >> >> { "execute": "migrate-set-parameters", >> "arguments": { "parameters": >> [ { "parameter": "compress-level", "value": 1 } ]= } } >> >> Awkward. I'd very much prefer >> >> { "execute": "migrate-set-parameters", >> "arguments": { "compress-level", 1 } } >> >> I.e. the command simply takes the parameters as optional arguments. >> Simpler, and a natural use of the schema language. Indeed, if we are going to add a new command, then we don't need to worry about making it super-generic, and can avoid the nesting of complex types. >=20 > Yes, it seems complicated. Eric suggested to use this type of interfac= e, because it can=20 > support different type of parameters if some new parameters will be add= ed. =20 When I originally suggested complex nested types, I was suggesting that we _reuse_ the existing migrate-set-capabilities (by making it set both boolean and integer capabilities in one go). If we do that, then we need the struct complexity. But since we are proposing a new command rather than shoe-horning into an existing command, we might as well do it cleanly to begin with. So I like Markus' suggestion that we eliminate some of the complexity and just go with specifying parameters directly. >> I'd very much prefer a simple object instead: >> >> { "return": { "compress-level": 1, >> "compress-threads": 8, >> "decompress-threads": 2 } } >> >=20 > The same reason. I like the idea as well. Sorry for misleading you into a more complex initial implementation when a simpler will do. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --87hmlheCEbcd9L9VMKgvMNQtxvCg236FF 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/ iQEcBAEBCAAGBQJVCt4/AAoJEKeha0olJ0NqHuAH/3wT9U/+7/dASQSDRfCFv4q5 ZJy0StgLCv0EauEA/mcNcCDKFZcQNsGkvMm12nkmQu1G9/+3e6CkmdBg41BvJFHt luyOs2jf+CWHYzBbZIQ7N2LgA3/zAa7VMhiqPKV3Bq9Rlr6+Y1m5BR+jTXIXt76P crHJup47pL8qo2Cn5E8slI0vaHV7THD7VqigPOO6PF68TCEOyRwTSnNXc2lguLdS L6eXqKLzSy19/UMbvaZgCgd4SMUqGkr3pkhZbHNbaAKiLB9BHQr5XbtyFoye82L7 Fh1c6bCvQwhoS7OJce/80z/s0wTsXuNRXB2jZ5vuwFm7WWkyYyqlzfSUN7cig/4= =WuZI -----END PGP SIGNATURE----- --87hmlheCEbcd9L9VMKgvMNQtxvCg236FF--