From: Markus Armbruster <armbru@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] error: report hints on stderr when no monitor
Date: Mon, 09 Jan 2017 14:14:18 +0100 [thread overview]
Message-ID: <87y3ykided.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <CAJ+F1CJzGCZt4pHmwOaDXMTg6V2t12Vt4WEcq2p+xbTZ9kCBdA@mail.gmail.com> ("Marc-André Lureau"'s message of "Mon, 09 Jan 2017 12:32:19 +0000")
Marc-André Lureau <marcandre.lureau@gmail.com> writes:
> Hi
>
> On Mon, Jan 9, 2017 at 1:23 PM Markus Armbruster <armbru@redhat.com> wrote:
>
>> Marc-André Lureau <marcandre.lureau@redhat.com> writes:
>>
>> > Report the error hint when running from the command line and reaching an
>>
>> Not just any hint, only the ones printed with error_printf_unless_qmp().
>>
>> > error, ex:
>> >
>> > $ qemu-system-x86_64 -m 1Z
>> > qemu-system-x86_64: -m 1Z: Parameter 'size' expects a size
>> > You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes
>> and terabytes.
>>
>> The last line is due to this patch.
>>
>> Suggest to rephrase the commit message:
>>
>> error: Report certain hints on stderr when no monitor
>>
>> Hints printed with error_printf_unless_qmp() are suppressed outside
>> monitor context. Reproducer:
>>
>> $ qemu-system-x86_64 -m 1Z
>> qemu-system-x86_64: -m 1Z: Parameter 'size' expects a size
>>
>> Print to stderr instead. The reproducer now additionally prints:
>>
>> You may use k, M, G or T suffixes for kilobytes, megabytes,
>> gigabytes and terabytes.
>>
>> >
>> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> > ---
>> > monitor.c | 2 ++
>> > 1 file changed, 2 insertions(+)
>> >
>> > diff --git a/monitor.c b/monitor.c
>> > index a82f547488..e5cc11b5a5 100644
>> > --- a/monitor.c
>> > +++ b/monitor.c
>> > @@ -3973,6 +3973,8 @@ void error_vprintf_unless_qmp(const char *fmt,
>> va_list ap)
>> > {
>> > if (cur_mon && !monitor_cur_is_qmp()) {
>> > monitor_vprintf(cur_mon, fmt, ap);
>> > + } else if (!cur_mon) {
>> > + vfprintf(stderr, fmt, ap);
>> > }
>> > }
>>
>> Preferably with an improved commit message:
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>>
>
> Markus, as maintainer of monitor.c, could you take the patch with the
> commit message modified?
Yes. It's in my error-next branch now.
prev parent reply other threads:[~2017-01-09 13:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 13:59 [Qemu-devel] [PATCH] error: report hints on stderr when no monitor Marc-André Lureau
2017-01-05 14:07 ` Paolo Bonzini
2017-01-05 15:39 ` Eric Blake
2017-01-09 12:18 ` Markus Armbruster
2017-01-09 12:32 ` Marc-André Lureau
2017-01-09 13:14 ` 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=87y3ykided.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=qemu-devel@nongnu.org \
/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.