From patchwork Tue Oct 20 07:11:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 532880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id ABB341401E7 for ; Tue, 20 Oct 2015 21:33:52 +1100 (AEDT) Received: from localhost ([::1]:44933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoUEo-0006eg-JQ for incoming@patchwork.ozlabs.org; Tue, 20 Oct 2015 06:33:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoR5D-0007hJ-Pl for qemu-devel@nongnu.org; Tue, 20 Oct 2015 03:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoR59-0001Xl-SL for qemu-devel@nongnu.org; Tue, 20 Oct 2015 03:11:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoR59-0001Xh-Mp; Tue, 20 Oct 2015 03:11:39 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E541CC0C188C; Tue, 20 Oct 2015 07:11:38 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-57.ams2.redhat.com [10.36.116.57]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9K7Bc0V031026; Tue, 20 Oct 2015 03:11:38 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id BBB6C81B05; Tue, 20 Oct 2015 09:11:37 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 20 Oct 2015 09:11:34 +0200 Message-Id: <1445325094-31868-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1445325094-31868-1-git-send-email-kraxel@redhat.com> References: <1445325094-31868-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: "Michael S. Tsirkin" , Gerd Hoffmann , qemu-stable@nongnu.org Subject: [Qemu-devel] [PULL 1/1] virtio-input: ignore events until the guest driver is ready X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann --- hw/input/virtio-input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c index 7b25d27..1f5a40d 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++;