From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viqnv-0002jH-SI for qemu-devel@nongnu.org; Tue, 19 Nov 2013 14:17:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Viqnp-0003uu-Na for qemu-devel@nongnu.org; Tue, 19 Nov 2013 14:17:43 -0500 Received: from v220110690675601.yourvserver.net ([37.221.199.173]:35113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Viqnp-0003uk-HA for qemu-devel@nongnu.org; Tue, 19 Nov 2013 14:17:37 -0500 Message-ID: <528BB93F.7020109@weilnetz.de> Date: Tue, 19 Nov 2013 20:17:19 +0100 From: Stefan Weil MIME-Version: 1.0 References: <528BAD62.8090103@terremark.com> In-Reply-To: <528BAD62.8090103@terremark.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Don't crash on keyboard input with no handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Don Koch , qemu-devel , Anthony Liguori Am 19.11.2013 19:26, schrieb Don Koch: > Prevent a call to put_kbd if null. > > On shutdown of some OSes, the keyboard handler goes away before the > system is down. If a key is typed during this window, qemu crashes. > > Signed-off-by: Don Koch > --- > I left the printf call, originally for testing, but useful as a sanity > check if the user wonders why his keyboard input was ignored. AFAIC, > it can be removed. I'd remove that printf and combine the two if statements in the final patch. > > PS: Anthony, your address in the MAINTAINER file is still at ibm. > I assume that is no longer correct, yes? The address is correct in the latest git version. > > ui/input.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/ui/input.c b/ui/input.c > index 92c44ca..28ef6a6 100644 > --- a/ui/input.c > +++ b/ui/input.c > @@ -415,8 +415,10 @@ void kbd_put_keycode(int keycode) > return; > } > if (entry) { > - entry->put_kbd(entry->opaque, keycode); > + if (entry->put_kbd) > + entry->put_kbd(entry->opaque, keycode); > + else > + printf("%s: no keyboard handler\n", __FUNCTION__); > } > } > Please check the coding style with scripts/checkpatch.pl. Regards, Stefan Weil