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)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 20 Oct 2015 06:53:40 +0000 (08:53 +0200)
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.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++;