qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [v7 13/14] migration: Add qmp commands to set and query


From: Eric Blake
Subject: Re: [Qemu-devel] [v7 13/14] migration: Add qmp commands to set and query parameters
Date: Tue, 14 Apr 2015 06:09:51 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

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 <address@hidden>
> Signed-off-by: Yang Zhang <address@hidden>
> ---
>  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 <address@hidden>

-- 
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

[Prev in Thread] Current Thread [Next in Thread]