qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [PATCH 6/6] migration: Fix a few absurdly defective error messages
Date: Fri, 13 Nov 2020 11:27:24 +0000	[thread overview]
Message-ID: <20201113112724.GE3251@work-vm> (raw)
In-Reply-To: <20201113065236.2644169-7-armbru@redhat.com>

* Markus Armbruster (armbru@redhat.com) wrote:
> migrate_params_check() has a number of error messages of the form
> 
>     Parameter 'NAME' expects is invalid, it should be ...
> 
> Fix them to something like
> 
>     Parameter 'NAME' expects a ...
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  migration/migration.c | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/migration/migration.c b/migration/migration.c
> index 3daed2da0e..5f9a10909d 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1240,21 +1240,21 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
>      if (params->has_compress_level &&
>          (params->compress_level > 9)) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level",
> -                   "is invalid, it should be in the range of 0 to 9");
> +                   "a value between 0 and 9");
>          return false;
>      }
>  
>      if (params->has_compress_threads && (params->compress_threads < 1)) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "compress_threads",
> -                   "is invalid, it should be in the range of 1 to 255");
> +                   "a value between 1 and 255");
>          return false;
>      }
>  
>      if (params->has_decompress_threads && (params->decompress_threads < 1)) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "decompress_threads",
> -                   "is invalid, it should be in the range of 1 to 255");
> +                   "a value between 1 and 255");
>          return false;
>      }
>  
> @@ -1307,21 +1307,21 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
>      if (params->has_multifd_channels && (params->multifd_channels < 1)) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "multifd_channels",
> -                   "is invalid, it should be in the range of 1 to 255");
> +                   "a value between 1 and 255");
>          return false;
>      }
>  
>      if (params->has_multifd_zlib_level &&
>          (params->multifd_zlib_level > 9)) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zlib_level",
> -                   "is invalid, it should be in the range of 0 to 9");
> +                   "a value between 0 and 9");
>          return false;
>      }
>  
>      if (params->has_multifd_zstd_level &&
>          (params->multifd_zstd_level > 20)) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zstd_level",
> -                   "is invalid, it should be in the range of 0 to 20");
> +                   "a value between 0 and 20");
>          return false;
>      }
>  
> @@ -1330,8 +1330,7 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
>           !is_power_of_2(params->xbzrle_cache_size))) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "xbzrle_cache_size",
> -                   "is invalid, it should be bigger than target page size"
> -                   " and a power of 2");
> +                   "a power of two no less than the target page size");
>          return false;
>      }
>  
> @@ -1348,21 +1347,21 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
>          params->announce_initial > 100000) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "announce_initial",
> -                   "is invalid, it must be less than 100000 ms");
> +                   "a value between 0 and 100000");
>          return false;
>      }
>      if (params->has_announce_max &&
>          params->announce_max > 100000) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "announce_max",
> -                   "is invalid, it must be less than 100000 ms");
> +                   "a value between 0 and 100000");
>         return false;
>      }
>      if (params->has_announce_rounds &&
>          params->announce_rounds > 1000) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "announce_rounds",
> -                   "is invalid, it must be in the range of 0 to 1000");
> +                   "a value between 0 and 1000");
>         return false;
>      }
>      if (params->has_announce_step &&
> @@ -1370,7 +1369,7 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
>          params->announce_step > 10000)) {
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "announce_step",
> -                   "is invalid, it must be in the range of 1 to 10000 ms");
> +                   "a value between 0 and 10000");
>         return false;
>      }
>  
> -- 
> 2.26.2
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



  reply	other threads:[~2020-11-13 11:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  6:52 [PATCH 0/6] migration: Fixes and cleanups aroung migrate-set-parameters Markus Armbruster
2020-11-13  6:52 ` [PATCH 1/6] migration: Fix and clean up around @tls-authz Markus Armbruster
2020-11-13 11:56   ` Dr. David Alan Gilbert
2020-12-10 17:35     ` Dr. David Alan Gilbert
2020-12-10 18:10   ` Daniel P. Berrangé
2020-12-14 10:14     ` Markus Armbruster
2020-12-16 10:55       ` Daniel P. Berrangé
2020-12-17 13:07         ` Markus Armbruster
2020-12-17 14:04           ` Daniel P. Berrangé
2021-01-27 16:01             ` Markus Armbruster
2020-11-13  6:52 ` [PATCH 2/6] migration: Fix migrate-set-parameters argument validation Markus Armbruster
2020-11-13 11:49   ` Dr. David Alan Gilbert
2020-11-13 13:24     ` Markus Armbruster
2020-11-13  6:52 ` [PATCH 3/6] migration: Clean up signed vs. unsigned XBZRLE cache-size Markus Armbruster
2020-11-13 10:40   ` Dr. David Alan Gilbert
2020-11-13  6:52 ` [PATCH 4/6] migration: Check xbzrle-cache-size more carefully Markus Armbruster
2020-11-13 10:59   ` Dr. David Alan Gilbert
2020-11-13 13:35     ` Markus Armbruster
2020-11-13 16:39       ` Dr. David Alan Gilbert
2020-11-16  7:00         ` Markus Armbruster
2020-11-13  6:52 ` [PATCH 5/6] migration: Fix cache_init()'s "Failed to allocate" error messages Markus Armbruster
2020-11-13 11:01   ` Dr. David Alan Gilbert
2020-11-13  6:52 ` [PATCH 6/6] migration: Fix a few absurdly defective " Markus Armbruster
2020-11-13 11:27   ` Dr. David Alan Gilbert [this message]
2020-11-13 11:56 ` [PATCH 0/6] migration: Fixes and cleanups aroung migrate-set-parameters Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201113112724.GE3251@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).