qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv2 1/2] ps2: Clear the PS/2 queue and obey disabl


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCHv2 1/2] ps2: Clear the PS/2 queue and obey disable
Date: Mon, 7 May 2018 16:46:26 +0200
User-agent: NeoMutt/20180323

  Hi,

> This allows guest's to correctly reinitialize and identify the mouse
> should the guest decide to re-scan or reset during mouse input events.
> 
> When the guest sends the "Identify" command, due to the PC's hardware
> architecutre it is impossible to reliably determine the response from
> the command amongst other streaming data, such as mouse or keyboard
> events. Standard practice is for the guest to disable the device and
> then issue the identify command, so this must be obeyed.
> 
> Signed-off-by: Geoffrey McRae <address@hidden>
> ---
>  hw/input/ps2.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> index 06f5d2ac4a..f84a8f5179 100644
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -232,6 +232,9 @@ static void ps2_keyboard_event(DeviceState *dev, 
> QemuConsole *src,
>      uint16_t keycode = 0;
>      int mod;
>  
> +    if (!s->scan_enabled)
> +        return;

qemu code style wants braces here.
See CODING_STYLE.
You can use scripts/checkpatch.pl for codestyle checks.

Code looks fine (both patches) now.

cheers,
  Gerd




reply via email to

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