All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, dgilbert@redhat.com, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Changing error message of QMP 'migrate_set_downtime' to seconds
Date: Fri, 17 Feb 2017 21:26:18 +0100	[thread overview]
Message-ID: <87wpcoa7it.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1867aaa8-57ba-0223-3b28-bac569f6f9de@redhat.com> (Eric Blake's message of "Fri, 17 Feb 2017 13:38:07 -0600")

Eric Blake <eblake@redhat.com> 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	other threads:[~2017-02-17 20:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 17:26 [Qemu-devel] [PATCH] Changing error message of QMP 'migrate_set_downtime' to seconds Daniel Henrique Barboza
2017-02-17 17:37 ` Paolo Bonzini
2017-02-17 19:01   ` Daniel Henrique Barboza
2017-02-17 19:38     ` Eric Blake
2017-02-17 20:26       ` Markus Armbruster [this message]

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=87wpcoa7it.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=danielhb@linux.vnet.ibm.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.