From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vir3Q-0006Os-KW for qemu-devel@nongnu.org; Tue, 19 Nov 2013 14:33:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vir3I-00085w-Hj for qemu-devel@nongnu.org; Tue, 19 Nov 2013 14:33:44 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:34449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vir3I-00085i-CW for qemu-devel@nongnu.org; Tue, 19 Nov 2013 14:33:36 -0500 From: Don Koch Message-ID: <528BBD0A.9040607@terremark.com> Date: Tue, 19 Nov 2013 14:33:30 -0500 MIME-Version: 1.0 References: <528BAD62.8090103@terremark.com> <528BB93F.7020109@weilnetz.de> In-Reply-To: <528BB93F.7020109@weilnetz.de> 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: Stefan Weil Cc: qemu-devel , Don Koch , Anthony Liguori On 11/19/2013 02:17 PM, Stefan Weil wrote: > 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. Works for me (if nobody thinks otherwise). >> >> 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. Count on me to be in the wrong branch when I checked that. >> >> 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. Of course, I remembered to do this afterwards. Turns out, the only problems will go away if I drop the printf. I meant to send a follow-up stating that and that I would wait to see what the consensus was on the printf before applying the appropriate changes (thunderbird had other ideas :-( ). > > Regards, > Stefan Weil Thanks, -d