From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YImu1-0005Rl-O5 for qemu-devel@nongnu.org; Tue, 03 Feb 2015 18:29:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YImty-0004Sr-E9 for qemu-devel@nongnu.org; Tue, 03 Feb 2015 18:29:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YImty-0004Sn-5W for qemu-devel@nongnu.org; Tue, 03 Feb 2015 18:29:02 -0500 Message-ID: <54D159BB.2020205@redhat.com> Date: Tue, 03 Feb 2015 16:28:59 -0700 From: Eric Blake MIME-Version: 1.0 References: <1422875149-13198-1-git-send-email-liang.z.li@intel.com> <1422875149-13198-13-git-send-email-liang.z.li@intel.com> In-Reply-To: <1422875149-13198-13-git-send-email-liang.z.li@intel.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lXLTRAM2XXrVR8h2EgLcDJowvLXdeowJn" Subject: Re: [Qemu-devel] [v4 12/13] migration: Add command to set migration parameter 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, dgilbert@redhat.com, Yang Zhang , amit.shah@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lXLTRAM2XXrVR8h2EgLcDJowvLXdeowJn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/02/2015 04:05 AM, Liang Li wrote: > Add the qmp and hmp commands to tune the parameters used in live > migration. >=20 > Signed-off-by: Liang Li > Signed-off-by: Yang Zhang > --- > hmp-commands.hx | 15 ++++++++++ > hmp.c | 35 ++++++++++++++++++++++ > hmp.h | 3 ++ > include/migration/migration.h | 4 +-- > migration/migration.c | 69 +++++++++++++++++++++++++++++++++++= -------- > monitor.c | 18 +++++++++++ > qapi-schema.json | 52 ++++++++++++++++++++++++++++++++ > qmp-commands.hx | 25 ++++++++++++++++ > 8 files changed, 206 insertions(+), 15 deletions(-) > +++ b/migration/migration.c > @@ -66,9 +66,12 @@ MigrationState *migrate_get_current(void) > .bandwidth_limit =3D MAX_THROTTLE, > .xbzrle_cache_size =3D DEFAULT_MIGRATE_CACHE_SIZE, > .mbps =3D -1, > - .compress_thread_count =3D DEFAULT_MIGRATE_COMPRESS_THREAD_COU= NT, > - .decompress_thread_count =3D DEFAULT_MIGRATE_DECOMPRESS_THREAD= _COUNT, > - .compress_level =3D DEFAULT_MIGRATE_COMPRESS_LEVEL, > + .parameters[MIGRATION_PARAMETER_COMPRESS_LEVEL] =3D > + DEFAULT_MIGRATE_COMPRESS_LEVEL, Looks okay. > + .parameters[MIGRATION_PARAMETER_COMPRESS_THREADS] =3D > + DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT, > + .parameters[MIGRATION_PARAMETER_DECOMPRESS_THREADS] =3D > + DEFAULT_MIGRATE_DECOMPRESS_THREAD_COUNT, Hmm - do we really need two parameters here? Remember, compress threads is used only on the source, and decompress threads is used only on the destination. Having a single parameter, 'threads', which is set to compression threads on source and decompression threads on destination, and which need not be equal between the two machines, should still work, right? > +++ b/qapi-schema.json > @@ -541,6 +541,58 @@ > ## > { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCap= abilityStatus']} > =20 > +# @MigrationParameter > +# > +# Migration parameters enumeration > +# > +# @compress-level: Set the compression level to be used in live migrat= ion, > +# the compression level is an integer between 0 and 9, where = 0 means > +# no compression, 1 means the best compression speed, and 9 m= eans best > +# compression ratio which will consume more CPU. > +# > +# @compress-threads: Set compression thread count to be used in live m= igration, > +# the compression thread count is an integer between 1 and 25= 5. > +# > +# @decompress-threads: Set decompression thread count to be used in li= ve migration, > +# the decompression thread count is an integer between 1 and = 255. > +# Again, I think you could get by with just a single parameter 'compress-threads', and maybe document that the value is typically set higher on destination than on source. > +# Since: 2.3 > +## > +{ 'enum': 'MigrationParameter', > + 'data': ['compress-level', 'compress-threads', 'decompress-threads']= } > +## > +# @MigrationParameterStatus > +# > +# Migration parameter information > +# > +# @parameter: the parameter of migration > +# > +# @data: pointer to the parameter value > +# > +# Since: 2.3 > +## > +{ 'type': 'MigrationParameterBase', > + 'data': {'parameter': 'MigrationParameter'} } > +{ 'type': 'MigrationParameterInt', > + 'data': {'value': 'int'} } > +{ 'union': 'MigrationParameterStatus', Is it worth having independent docs for each of these, rather than cramming all three under one doc text? > + 'base': 'MigrationParameterBase', > + 'discriminator': 'parameter', > + 'data': { 'compress-level': 'MigrationParameterInt', > + 'compress-threads': 'MigrationParameterInt', > + 'decompress-threads': 'MigrationParameterInt'} } > +# > +# @migrate-set-parameters > +# > +# Set the following migration parameters (like compress-level) > +# > +# @parameters: json array of parameter modifications to make > +# > +# Since: 2.3 > +## > +{ 'command': 'migrate-set-parameters', > + 'data': { 'parameters': ['MigrationParameterStatus'] } } > +## Interface looks reasonable to me (but I'm biased, as I suggested it). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lXLTRAM2XXrVR8h2EgLcDJowvLXdeowJn 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/ iQEcBAEBCAAGBQJU0Vm7AAoJEKeha0olJ0NqYvEIAIRfKBzFzw/zMUGlTtJLdwl/ Qe/tl9Zx+JmYzSL6lWi/c0tiskN9KNFLymV6Buu3ngcycqHXIN0/xPN1fAPIQ0fH s9/kO9+RbdVyl9xiOKburA1xLRI6FaQjevHRiAiCfls3WyvU7kdiE/diH61+wstb Vudl7eZcA3o31cgeHQ2YjoP2jg7bQ6fDuu+a33K9b7jnQikHZvbsNHAYGvKno0WX hZ2KHRHbJLwnGsEkkCU1VJspzjEacQIsNBSm37Grwgg8fdA7xDr0frrt74DE7YdL wF/g/8Dird+kC6hkST552LIHNHRcBL4h6pbvwhRRFzDrQgEvU8o4aQhgGCUSluo= =IjaI -----END PGP SIGNATURE----- --lXLTRAM2XXrVR8h2EgLcDJowvLXdeowJn--