From nobody Mon Feb 9 08:57:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508750526199940.7624663311011; Mon, 23 Oct 2017 02:22:06 -0700 (PDT) Received: from localhost ([::1]:37635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Yvj-0007Fj-Ma for importer@patchew.org; Mon, 23 Oct 2017 05:21:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Ytp-0005y8-JN for qemu-devel@nongnu.org; Mon, 23 Oct 2017 05:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6Ytn-0005ZD-J2 for qemu-devel@nongnu.org; Mon, 23 Oct 2017 05:19:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37860) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6Ytn-0005Z2-AO for qemu-devel@nongnu.org; Mon, 23 Oct 2017 05:19:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F006B651 for ; Mon, 23 Oct 2017 09:19:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-195.ams2.redhat.com [10.36.117.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id D19EF5DA66; Mon, 23 Oct 2017 09:19:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F3A2840572; Mon, 23 Oct 2017 11:19:47 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6F006B651 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 23 Oct 2017 11:19:46 +0200 Message-Id: <20171023091947.20771-9-kraxel@redhat.com> In-Reply-To: <20171023091947.20771-1-kraxel@redhat.com> References: <20171023091947.20771-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 23 Oct 2017 09:19:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] ui: normalize the 'sysrq' key into the 'print' key 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: Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" The 'sysrq' key was mistakenly added to QEMU to deal with incorrect handling of the 'print' key in the ps2 device: commit f2289cb6924afc97b2a75d21bfc9217024d11741 Author: balrog Date: Wed Jun 4 10:14:16 2008 +0000 Add sysrq to key names known by "sendkey". Adding sysrq keycode to the table enabling running sysrq debugging in the guest via the monitor sendkey command, like: (qemu) sendkey alt-sysrq-t Tested on x86-64 target and Linux guest. Signed-off-by: Ryan Harper The ps2 device is now fixed wrt modifiers and the 'print' key. Further the handling of the 'sysrq' key has some problems of its own, documented in the previous commit. To cleanup this mess, we convert any use of 'sysrq' into 'print' prior to dispatching the event to device models. Signed-off-by: Daniel P. Berrange Message-id: 20171019142848.572-9-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/input.c | 14 ++++++++++++++ qapi/ui.json | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/ui/input.c b/ui/input.c index 4e821f8f2b..3e2d324278 100644 --- a/ui/input.c +++ b/ui/input.c @@ -353,6 +353,20 @@ void qemu_input_event_send(QemuConsole *src, InputEven= t *evt) assert(!(evt->type =3D=3D INPUT_EVENT_KIND_KEY && evt->u.key.data->key->type =3D=3D KEY_VALUE_KIND_NUMBER)); =20 + + /* + * 'sysrq' was mistakenly added to hack around the fact that + * the ps2 driver was not generating correct scancodes sequences + * when 'alt+print' was pressed. This flaw is now fixed and the + * 'sysrq' key serves no further purpose. We normalize it to + * 'print', so that downstream receivers of the event don't + * neeed to deal with this mistake + */ + if (evt->type =3D=3D INPUT_EVENT_KIND_KEY && + evt->u.key.data->key->u.qcode.data =3D=3D Q_KEY_CODE_SYSRQ) { + evt->u.key.data->key->u.qcode.data =3D Q_KEY_CODE_PRINT; + } + if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) { return; } diff --git a/qapi/ui.json b/qapi/ui.json index e5d6610b4a..07b468f625 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -748,6 +748,13 @@ # @ac_bookmarks: since 2.10 # altgr, altgr_r: dropped in 2.10 # +# 'sysrq' was mistakenly added to hack around the fact that +# the ps2 driver was not generating correct scancodes sequences +# when 'alt+print' was pressed. This flaw is now fixed and the +# 'sysrq' key serves no further purpose. Any further use of +# 'sysrq' will be transparently changed to 'print', so they +# are effectively synonyms. +# # Since: 1.3.0 # ## --=20 2.9.3