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
signature.asc
Description: OpenPGP digital signature