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: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: Replace pc/xt keyboard keycode array with QKeyCode
Date: Tue, 1 Mar 2016 19:14:51 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

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.  But that's more
plumbing effort, so it doesn't necessarily have to be you doing the
work, nor this series.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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