From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhzfE-00007K-MC for qemu-devel@nongnu.org; Tue, 14 Apr 2015 08:10:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yhzf8-00010i-8s for qemu-devel@nongnu.org; Tue, 14 Apr 2015 08:10:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yhzf8-00010Z-1N for qemu-devel@nongnu.org; Tue, 14 Apr 2015 08:09:54 -0400 Message-ID: <552D038F.4020503@redhat.com> Date: Tue, 14 Apr 2015 06:09:51 -0600 From: Eric Blake MIME-Version: 1.0 References: <1428474011-30797-1-git-send-email-liang.z.li@intel.com> <1428474011-30797-14-git-send-email-liang.z.li@intel.com> In-Reply-To: <1428474011-30797-14-git-send-email-liang.z.li@intel.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="56UrHi63usKuttCeKP0p31HF4IHr6ORjM" Subject: Re: [Qemu-devel] [v7 13/14] migration: Add qmp commands to set and query parameters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liang Li , qemu-devel@nongnu.org Cc: quintela@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, Yang Zhang , amit.shah@redhat.com, dgilbert@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --56UrHi63usKuttCeKP0p31HF4IHr6ORjM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/08/2015 12:20 AM, Liang Li wrote: > Add the qmp commands to tune and query the parameters used in live > migration. >=20 > Signed-off-by: Liang Li > Signed-off-by: Yang Zhang > --- > migration/migration.c | 56 +++++++++++++++++++++++++++++++++++++++++++= +++++++ > qapi-schema.json | 45 ++++++++++++++++++++++++++++++++++++++++ > qmp-commands.hx | 57 +++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 3 files changed, 158 insertions(+) >=20 > +void qmp_migrate_set_parameters(bool has_compress_level, > + int64_t compress_level, > + bool has_compress_threads, > + int64_t compress_threads, > + bool has_decompress_threads, > + int64_t decompress_threads, Error **er= rp) > +{ > + MigrationState *s =3D migrate_get_current(); > + > + if (has_compress_level && (compress_level < 0 || compress_level > = 9)) { > + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level"= , > + "is invalid, it should be in the range of 0 to 9"); > + return; > + } > + if (has_compress_threads && > + (compress_threads < 1 || compress_threads > 255)) { Indentation is unusual. > + error_set(errp, QERR_INVALID_PARAMETER_VALUE, > + "compress_threads", > + "is invalid, it should be in the range of 1 to 255")= ; > + return; > + } > + if (has_decompress_threads && > + (decompress_threads < 1 || decompress_threads > 255)) { and again > +++ b/qapi-schema.json > @@ -592,6 +592,51 @@ > { 'enum': 'MigrationParameter', > 'data': ['compress-level', 'compress-threads', 'decompress-threads']= } > =20 > +# > +# @migrate-set-parameters > +# > +# Set the following migration parameters > +# > +# @compress-level: compression level > +# > +# @compress-threads: compression thread count > +# > +# @decompress-threads: decompression thread count > +# > +# Since: 2.3 2.4 > +## > +{ 'command': 'migrate-set-parameters', > + 'data': { '*compress-level': 'int', > + '*compress-threads': 'int', > + '*decompress-threads': 'int'} } > + > +# > +# @MigrationParameters > +# > +# @compress-level: compression level > +# > +# @compress-threads: compression thread count > +# > +# @decompress-threads: decompression thread count > +# > +# Since: 2.3 2.4 > +## > +{ 'type': 'MigrationParameters', > + 'data': { 'compress-level': 'int', > + 'compress-threads': 'int', > + 'decompress-threads': 'int'} } > +## > +# @query-migrate-parameters > +# > +# Returns information about the current migration parameters > +# > +# Returns: @MigrationParameters > +# > +# Since: 2.3 2.4 > SQMP > +migrate-set-parameters > +---------------------- > + > +Set migration parameters > + > +- "compress-level": set compression level during migration (json-int) > +- "compress-threads": set compression thread count for migration (json= -int) > +- "decompress-threads": set decompression thread count for migration (= json-int) Might be worth mentioning that on input, all three are optional; and omitting them leaves the value unchanged, so mentioning the default is also nice Minor enough that I'm okay if the maintainer fixes the release number and adds: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --56UrHi63usKuttCeKP0p31HF4IHr6ORjM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVLQOPAAoJEKeha0olJ0NqTnAIAImBn3Z/uzl8Cc45ZhxPgiMh ccA0uqC6mDUixxIA6ljx8E7ElQ1BKpMTj5c31OxFxl2T//9kz7RuNUupw7JMJ07B KbkBAUNzsr8D+eKv+TDuGNuFz7Zi16PatpLZT1jiZhiGP7NNtPf+Hey60MLOQDJf ubjpoUlC57JwKm/L0VtGuDIjgM+5Ch4wb5JfIfCXeOsgPygPMpUoJLbb+2lhiLYh KVFuOD9gYySTXZ+TXWafC/oHPsz/QDGVeyCyQrZx/LC81t+fRAQZLh0Q2E9exBa/ 71HiaOr/4wq69CgXfK8i6s2Qhlyq6MbsOzHZD+Gc5OMzOJkt6+VHp6F6zAX2cGw= =CFwJ -----END PGP SIGNATURE----- --56UrHi63usKuttCeKP0p31HF4IHr6ORjM--