> +static void i8042_isa_mouse_fake_event(void *opaque, int n, int level)
>  {
>      ISADevice *dev = opaque;
>      KBDState *s = &(DO_UPCAST(ISAKBDState, dev, dev)->kbd);
>  
> -    ps2_mouse_fake_event(s->mouse);
> +    if (level) {
> +        ps2_mouse_fake_event(s->mouse);
> +    }
>  }
>...  
> @@ -99,7 +99,7 @@ static void vmmouse_mouse_event(void *opaque, int x, int
>      /* need to still generate PS2 events to notify driver to
>         read from queue */
> -    i8042_isa_mouse_fake_event(s->ps2_mouse);
> +    qemu_set_irq(s->ps2_mouse_event, 1);
>  }

Both of these are wrong. qemu_irq represents a state. It is not an messge 
passing API.  Currently we don't discard duplicate sets, but that may change 
in the future.

If you want to convey an event via an IRQ line you need to actually cause and 
detect state changes.  i.e. i8042_isa_mouse_fake_event needs to remember the 
previous state, and only act on a low-high transition.  vmmouse_mouse_event 
should use qemu_irq_pulse.

Paul

Reply via email to