From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Programmingkid <programmingkidx@gmail.com>,
qemu-devel qemu-devel <qemu-devel@nongnu.org>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: Replace pc/xt keyboard keycode array with QKeyCode
Date: Wed, 02 Mar 2016 10:29:36 +0100 [thread overview]
Message-ID: <87si09qlbz.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <56D64C9B.6060305@redhat.com> (Eric Blake's message of "Tue, 1 Mar 2016 19:14:51 -0700")
Eric Blake <eblake@redhat.com> writes:
> On 03/01/2016 06:20 PM, Programmingkid wrote:
>
>>> You weren't the original cause of the bug, so it is not necessarily this
>>> patch's job to fix the bug. Therefore, "pre-existing". But since the
>>> bug was observed during review of your patch, you may want to fix it
>>> anyways, probably as a separate patch.
>>
>> So you want this:
>>
>> if (ARRAY_SIZE(macToQKeyCodeMap) <= keycode) {
>> error_report("(cocoa) warning unknown keycode 0x%x\n", keycode);
>
> Or something similar. Yes, error_report() is better than fprintf. But
> error_report() is only good if you are directly interacting with the
> user; if this code can be reached via a QMP monitor command, it would be
> better to adjust signatures and propagate an Error **errp back to the
> caller, so that the caller knows how best to report it.
An error that makes a QMP command fail must be propagated to the QMP
core with Error objects. To find out how, study the big comment in
error.h, and the copious examples in the code.
Reporting such errors with error_report(), fprintf() or similar instead
is a bug.
> But that's more
> plumbing effort, so it doesn't necessarily have to be you doing the
> work, nor this series.
Yes.
next prev parent reply other threads:[~2016-03-02 9:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 22:12 [Qemu-devel] [PATCH] ui/cocoa.m: Replace pc/xt keyboard keycode array with QKeyCode Programmingkid
2016-03-01 23:16 ` Eric Blake
2016-03-02 0:12 ` Programmingkid
2016-03-02 0:25 ` Eric Blake
2016-03-02 1:20 ` Programmingkid
2016-03-02 2:14 ` Eric Blake
2016-03-02 9:29 ` Markus Armbruster [this message]
2016-03-01 23:18 ` Peter Maydell
2016-03-02 0:18 ` Programmingkid
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=87si09qlbz.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=programmingkidx@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.