diff mbox series

[v2,10/22] qapi: Correct error message for 'vcpu_dirty_limit' parameter

Message ID 20231005045041.52649-11-philmd@linaro.org
State New
Headers show
Series qapi: Kill 'qapi/qmp/qerror.h' for good | expand

Commit Message

Philippe Mathieu-Daudé Oct. 5, 2023, 4:50 a.m. UTC
QERR_INVALID_PARAMETER_VALUE is defined as:

  #define QERR_INVALID_PARAMETER_VALUE \
      "Parameter '%s' expects %s"

The current error is formatted as:

  "Parameter 'vcpu_dirty_limit' expects is invalid, it must greater then 1 MB/s"

Replace by:

  "Parameter 'vcpu_dirty_limit' is invalid, it must greater then 1 MB/s"

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 migration/options.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Juan Quintela Oct. 5, 2023, 6:33 a.m. UTC | #1
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> QERR_INVALID_PARAMETER_VALUE is defined as:
>
>   #define QERR_INVALID_PARAMETER_VALUE \
>       "Parameter '%s' expects %s"
>
> The current error is formatted as:
>
>   "Parameter 'vcpu_dirty_limit' expects is invalid, it must greater then 1 MB/s"
>
> Replace by:
>
>   "Parameter 'vcpu_dirty_limit' is invalid, it must greater then 1 MB/s"
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Juan Quintela <quintela@redhat.com>
Markus Armbruster Oct. 20, 2023, 8:33 a.m. UTC | #2
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> QERR_INVALID_PARAMETER_VALUE is defined as:
>
>   #define QERR_INVALID_PARAMETER_VALUE \
>       "Parameter '%s' expects %s"
>
> The current error is formatted as:
>
>   "Parameter 'vcpu_dirty_limit' expects is invalid, it must greater then 1 MB/s"
>
> Replace by:
>
>   "Parameter 'vcpu_dirty_limit' is invalid, it must greater then 1 MB/s"
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  migration/options.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/migration/options.c b/migration/options.c
> index 1d1e1321b0..79fce0c3a9 100644
> --- a/migration/options.c
> +++ b/migration/options.c
> @@ -1163,9 +1163,8 @@ bool migrate_params_check(MigrationParameters *params, Error **errp)
>  
>      if (params->has_vcpu_dirty_limit &&
>          (params->vcpu_dirty_limit < 1)) {
> -        error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
> -                   "vcpu_dirty_limit",
> -                   "is invalid, it must greater then 1 MB/s");
> +        error_setg(errp, "Parameter 'vcpu_dirty_limit' is invalid,"
> +                         " it must greater then 1 MB/s");
>          return false;
>      }

Make that "greater than", please.

Arrgh, the unit is MB/s even in QMP:

    # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
    #     Defaults to 1.  (Since 8.1)

Should be Bytes.  Escaped review, and now it's too late to fix.
Juan Quintela Oct. 20, 2023, 9:55 a.m. UTC | #3
Markus Armbruster <armbru@redhat.com> wrote:
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
>> QERR_INVALID_PARAMETER_VALUE is defined as:
>>
>>   #define QERR_INVALID_PARAMETER_VALUE \
>>       "Parameter '%s' expects %s"
>>
>> The current error is formatted as:
>>
>>   "Parameter 'vcpu_dirty_limit' expects is invalid, it must greater then 1 MB/s"
>>
>> Replace by:
>>
>>   "Parameter 'vcpu_dirty_limit' is invalid, it must greater then 1 MB/s"
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>  migration/options.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/migration/options.c b/migration/options.c
>> index 1d1e1321b0..79fce0c3a9 100644
>> --- a/migration/options.c
>> +++ b/migration/options.c
>> @@ -1163,9 +1163,8 @@ bool migrate_params_check(MigrationParameters *params, Error **errp)
>>  
>>      if (params->has_vcpu_dirty_limit &&
>>          (params->vcpu_dirty_limit < 1)) {
>> -        error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>> -                   "vcpu_dirty_limit",
>> -                   "is invalid, it must greater then 1 MB/s");
>> +        error_setg(errp, "Parameter 'vcpu_dirty_limit' is invalid,"
>> +                         " it must greater then 1 MB/s");
>>          return false;
>>      }
>
> Make that "greater than", please.
>
> Arrgh, the unit is MB/s even in QMP:
>
>     # @vcpu-dirty-limit: Dirtyrate limit (MB/s) during live migration.
>     #     Defaults to 1.  (Since 8.1)
>
> Should be Bytes.  Escaped review, and now it's too late to fix.

I want a Time Machine.
I want a Time Machine.

Wait, if I had a Time Machine I would not be fixing old bugs O:-)

Later, Juan.
diff mbox series

Patch

diff --git a/migration/options.c b/migration/options.c
index 1d1e1321b0..79fce0c3a9 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -1163,9 +1163,8 @@  bool migrate_params_check(MigrationParameters *params, Error **errp)
 
     if (params->has_vcpu_dirty_limit &&
         (params->vcpu_dirty_limit < 1)) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
-                   "vcpu_dirty_limit",
-                   "is invalid, it must greater then 1 MB/s");
+        error_setg(errp, "Parameter 'vcpu_dirty_limit' is invalid,"
+                         " it must greater then 1 MB/s");
         return false;
     }