From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aawJU-0006Ix-2g for qemu-devel@nongnu.org; Tue, 01 Mar 2016 21:14:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aawJQ-0006dd-Tl for qemu-devel@nongnu.org; Tue, 01 Mar 2016 21:14:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aawJQ-0006dQ-Os for qemu-devel@nongnu.org; Tue, 01 Mar 2016 21:14:52 -0500 References: <6FDF78F9-D147-4239-9B8E-CAB1417369AA@gmail.com> <56D622BC.6090600@redhat.com> <296156E0-31D8-4612-B3B7-AB93093353D3@gmail.com> <56D632F7.7000500@redhat.com> <5F294002-672A-4E4D-948F-39070F53F063@gmail.com> From: Eric Blake Message-ID: <56D64C9B.6060305@redhat.com> Date: Tue, 1 Mar 2016 19:14:51 -0700 MIME-Version: 1.0 In-Reply-To: <5F294002-672A-4E4D-948F-39070F53F063@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NWOXJJuRRJERFGmVlrSOsja7ARs5x5eOo" Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: Replace pc/xt keyboard keycode array with QKeyCode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid Cc: Peter Maydell , qemu-devel qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NWOXJJuRRJERFGmVlrSOsja7ARs5x5eOo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/01/2016 06:20 PM, Programmingkid wrote: >> You weren't the original cause of the bug, so it is not necessarily th= is >> 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. >=20 > So you want this: >=20 > if (ARRAY_SIZE(macToQKeyCodeMap) <=3D 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NWOXJJuRRJERFGmVlrSOsja7ARs5x5eOo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW1kybAAoJEKeha0olJ0NqVGIH/iIB1eQEVwDO48gSwbmroa6d xIiupkjgjn2v3panWguZA5rb2b8n8BP3iz/2dljmL1m38Y5KxJ/i/h92KzcIqpu6 fTgYSi0VtDoRIjDZQkhBYZZV4OHp8hGxaiAeyzjli6edXRKXEiE+wo6y2pyIn2bZ BxjtWA/hoN1rvwIE0hb8t0qxigDoBqyI8cpINn+E6hPOeI7/ZKwDOXAIdd3BGb4e O+kOegH1v60d0cq0NC+n8scK2RJsJECFcD0sJ0+EU714Ds3LyNC8GEcDepNZ50V1 tYWyX6R56QVfmmetxcZcjvhhRA+GYTSsjsXEDyzDb+VFVCYF7Pm2jabtHsmAsr4= =7tj9 -----END PGP SIGNATURE----- --NWOXJJuRRJERFGmVlrSOsja7ARs5x5eOo--