On 04/08/2015 12:20 AM, Liang Li wrote:
> Add the qmp commands to tune and query the parameters used in live
> migration.
> 
> Signed-off-by: Liang Li <liang.z...@intel.com>
> Signed-off-by: Yang Zhang <yang.z.zh...@intel.com>
> ---
>  migration/migration.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  qapi-schema.json      | 45 ++++++++++++++++++++++++++++++++++++++++
>  qmp-commands.hx       | 57 
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 158 insertions(+)
> 

> +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 **errp)
> +{
> +    MigrationState *s = 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'] }
>  
> +#
> +# @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 <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to