提交 99c7f878 编写于 作者: G Gerd Hoffmann 提交者: Anthony Liguori

input: send kbd+mouse events only to running guests.

Trying to interact with a stopped guest will queue up the events,
then send them all at once when the guest continues running, with
a high chance to have them cause unwanted actions.

Avoid that by only injecting the input events only when the guest
is in running state.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 aa24822b
......@@ -130,6 +130,9 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry)
void kbd_put_keycode(int keycode)
{
if (!runstate_is_running()) {
return;
}
if (qemu_put_kbd_event) {
qemu_put_kbd_event(qemu_put_kbd_event_opaque, keycode);
}
......@@ -151,6 +154,9 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state)
void *mouse_event_opaque;
int width, height;
if (!runstate_is_running()) {
return;
}
if (QTAILQ_EMPTY(&mouse_handlers)) {
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册