From patchwork Thu Sep 15 20:06:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 9334681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9519601C2 for ; Thu, 15 Sep 2016 20:10:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD9F329B34 for ; Thu, 15 Sep 2016 20:10:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C25BD29B38; Thu, 15 Sep 2016 20:10:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4037529B34 for ; Thu, 15 Sep 2016 20:08:56 +0000 (UTC) Received: from localhost ([::1]:37146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkcwh-0006ny-CW for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Sep 2016 16:07:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkcw7-0006nc-6y for qemu-devel@nongnu.org; Thu, 15 Sep 2016 16:07:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkcw3-000393-M5 for qemu-devel@nongnu.org; Thu, 15 Sep 2016 16:07:06 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:47514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkcw3-00038o-EY for qemu-devel@nongnu.org; Thu, 15 Sep 2016 16:07:03 -0400 Received: from localhost.localdomain (unknown [82.227.227.196]) by smtp2-g21.free.fr (Postfix) with ESMTP id 78F6B20037A; Thu, 15 Sep 2016 22:07:01 +0200 (CEST) From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: qemu-devel@nongnu.org Date: Thu, 15 Sep 2016 22:06:27 +0200 Message-Id: <1473969987-5890-6-git-send-email-hpoussin@reactos.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1473969987-5890-1-git-send-email-hpoussin@reactos.org> References: <1473969987-5890-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 212.27.42.2 Subject: [Qemu-devel] [PATCH v2 5/5] ps2: do not generate invalid key codes for unknown keys X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Gerd Hoffmann , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead, print a warning message. Signed-off-by: Hervé Poussineau --- hw/input/ps2.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 98da984..0d14de0 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/hw.h" #include "hw/input/ps2.h" #include "ui/console.h" @@ -621,7 +622,8 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src, } ps2_put_keycode(s, keycode & 0xff); } else { - ps2_queue(&s->common, key->down ? 0x00 : 0x80); + qemu_log_mask(LOG_UNIMP, + "ps2: ignoring key with qcode %d\n", qcode); } } } else if (s->scancode_set == 2) { @@ -660,13 +662,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src, ps2_put_keycode(s, 0xf0); } ps2_put_keycode(s, keycode & 0xff); - } else if (key->down) { - ps2_queue(&s->common, 0x00); - } else if (s->translate) { - ps2_queue(&s->common, 0x80); } else { - ps2_queue(&s->common, 0xf0); - ps2_queue(&s->common, 0x00); + qemu_log_mask(LOG_UNIMP, + "ps2: ignoring key with qcode %d\n", qcode); } } } else if (s->scancode_set == 3) { @@ -677,13 +675,9 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src, ps2_put_keycode(s, 0xf0); } ps2_put_keycode(s, keycode); - } else if (key->down) { - ps2_queue(&s->common, 0x00); - } else if (s->translate) { - ps2_queue(&s->common, 0x80); } else { - ps2_queue(&s->common, 0xf0); - ps2_queue(&s->common, 0x00); + qemu_log_mask(LOG_UNIMP, + "ps2: ignoring key with qcode %d\n", qcode); } } }