[Top][All Lists]

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

Re: [Qemu-devel] [PATCH] Changing error message of QMP 'migrate_set_down

From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] Changing error message of QMP 'migrate_set_downtime' to seconds
Date: Fri, 17 Feb 2017 21:26:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 02/17/2017 01:01 PM, Daniel Henrique Barboza wrote:
>>>> 2000000)) {
>>>> +        (params->downtime_limit < 0 ||
>>>> +         params->downtime_limit > MAX_MIGRATE_SET_DOWNTIME)) {
>>>>           error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>>>>                      "downtime_limit",
>>>> -                   "an integer in the range of 0 to 2000000
>>>> milliseconds");
>>>> +                   "an integer in the range of 0 to 2000 seconds");
>>> Perhaps you could use %d and set  MAX_MIGRATE_SET_DOWNTIME to 2000?
>>> Though perhaps the migration maintainers are okay with the patch as is.
>> I did that at first but I got errors on "error_setg" about the extra
>> parameter.
> Ah, right, because QERR_INVALID_PARAMETER_VALUE is a macro that expands
> to a fixed printf-style format string where you have to know how many
> exact arguments it further expects.  The only way around that is to
> open-code the error message you want, instead of forcing the use of the
> awkward macro.

Go ahead and open-code whenever that results in better error messages.

reply via email to

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