From: Eric Blake <eblake@redhat.com>
To: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Cc: 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 13:38:07 -0600 [thread overview]
Message-ID: <1867aaa8-57ba-0223-3b28-bac569f6f9de@redhat.com> (raw)
In-Reply-To: <6fe6a499-faa2-1e3d-a419-d33b2e538e7c@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]
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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-02-17 19:38 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 [this message]
2017-02-17 20:26 ` Markus Armbruster
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=1867aaa8-57ba-0223-3b28-bac569f6f9de@redhat.com \
--to=eblake@redhat.com \
--cc=danielhb@linux.vnet.ibm.com \
--cc=dgilbert@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 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).