qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] ui/cocoa.m: Replace pc/xt keyboard keycode arra


From: Markus Armbruster
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> 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.



reply via email to

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