From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrange" <berrange@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>, Eric Blake <eblake@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Subject: [Qemu-devel] [PULL 8/9] ui: normalize the 'sysrq' key into the 'print' key
Date: Mon, 23 Oct 2017 11:19:46 +0200 [thread overview]
Message-ID: <20171023091947.20771-9-kraxel@redhat.com> (raw)
In-Reply-To: <20171023091947.20771-1-kraxel@redhat.com>
From: "Daniel P. Berrange" <berrange@redhat.com>
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 <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
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 <ryanh@us.ibm.com>
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 <berrange@redhat.com>
Message-id: 20171019142848.572-9-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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, InputEvent *evt)
assert(!(evt->type == INPUT_EVENT_KIND_KEY &&
evt->u.key.data->key->type == KEY_VALUE_KIND_NUMBER));
+
+ /*
+ * '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 == INPUT_EVENT_KIND_KEY &&
+ evt->u.key.data->key->u.qcode.data == Q_KEY_CODE_SYSRQ) {
+ evt->u.key.data->key->u.qcode.data = 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
#
##
--
2.9.3
next prev parent reply other threads:[~2017-10-23 9:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 9:19 [Qemu-devel] [PULL 0/9] Input 20171023 patches Gerd Hoffmann
2017-10-23 9:19 ` [Qemu-devel] [PULL 1/9] input: use hex in ps2 keycode trace events Gerd Hoffmann
2017-10-23 9:19 ` [Qemu-devel] [PULL 2/9] ui: fix crash with sendkey and raw key numbers Gerd Hoffmann
2017-10-23 9:19 ` [Qemu-devel] [PULL 3/9] ui: use correct union field for key number Gerd Hoffmann
2017-10-23 9:19 ` [Qemu-devel] [PULL 4/9] ps2: fix scancodes sent for Alt-Print key combination (aka SysRq) Gerd Hoffmann
2017-10-27 7:29 ` Daniel P. Berrange
2017-11-01 7:58 ` Gerd Hoffmann
2017-11-01 10:00 ` Daniel P. Berrange
2017-10-23 9:19 ` [Qemu-devel] [PULL 5/9] ps2: fix scancodes sent for Shift/Ctrl+Print key combination Gerd Hoffmann
2017-10-23 9:19 ` [Qemu-devel] [PULL 6/9] ps2: fix scancodess sent for Pause key in AT set 1 Gerd Hoffmann
2017-10-23 9:19 ` [Qemu-devel] [PULL 7/9] ps2: fix scancodes sent for Ctrl+Pause key combination Gerd Hoffmann
2017-10-23 9:19 ` Gerd Hoffmann [this message]
2017-10-23 9:19 ` [Qemu-devel] [PULL 9/9] ui: pull in latest keycodemapdb Gerd Hoffmann
2017-10-25 14:23 ` [Qemu-devel] [PULL 0/9] Input 20171023 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171023091947.20771-9-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).