On Mon, May 07, 2018 at 10:00:22PM +1000, geoff--- via Qemu-devel wrote:
> This allows guest's to correctly reinitialize and identify the mouse
> should the guest decide to re-scan or reset during mouse input events.
> 
> Signed-off-by: Geoffrey McRae <ge...@hostfission.com>
> ---
>  hw/input/ps2.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> index 06f5d2ac4a..6edf046820 100644
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -673,6 +673,9 @@ static void ps2_mouse_sync(DeviceState *dev)
>  {
>      PS2MouseState *s = (PS2MouseState *)dev;
> 
> +    if (!(s->mouse_status & MOUSE_STATUS_ENABLED))
> +        return;
> +

Why this is needed?

> @@ -776,6 +779,7 @@ void ps2_write_mouse(void *opaque, int val)
>              s->mouse_resolution = 2;
>              s->mouse_status = 0;
>              s->mouse_type = 0;
> +            ps2_reset_queue(&s->common);

Looks good.

cheers,
  Gerd


Reply via email to