virtio-input: ignore events until the guest driver is ready
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 16 Oct 2015 11:33:07 +0000 (13:33 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 21 Oct 2015 17:35:21 +0000 (12:35 -0500)
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit d9460a7557672af9c4d9d4f153200d1075ed5a78)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/input/virtio-input.c

index 7b25d27..1f5a40d 100644 (file)
@@ -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++;