qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Don't crash on keyboard input with no handler


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] Don't crash on keyboard input with no handler
Date: Tue, 19 Nov 2013 20:17:19 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

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 <address@hidden>
> ---
> 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




reply via email to

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