aboutsummaryrefslogtreecommitdiff
path: root/hw/input/virtio-input.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-10-16 13:33:07 +0200
committerGerd Hoffmann <kraxel@redhat.com>2015-10-20 08:53:40 +0200
commitd9460a7557672af9c4d9d4f153200d1075ed5a78 (patch)
treeaa5405ad3abfe6a12582a7d7711684f576ba4979 /hw/input/virtio-input.c
parent26c7be842637ee65a79cd77f96a99c23ddcd90ad (diff)
virtio-input: ignore events until the guest driver is ready
Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/input/virtio-input.c')
-rw-r--r--hw/input/virtio-input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c
index 7b25d27693..1f5a40de35 100644
--- a/hw/input/virtio-input.c
+++ b/hw/input/virtio-input.c
@@ -20,6 +20,10 @@ void virtio_input_send(VirtIOInput *vinput, virtio_input_event *event)
unsigned have, need;
int i, len;
+ if (!vinput->active) {
+ return;
+ }
+
/* queue up events ... */
if (vinput->qindex == vinput->qsize) {
vinput->qsize++;