From 13b432eb7f6adb1ed271f04f16531a91d7397e9f Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 19 Oct 2017 14:11:58 +0100 Subject: Add hack for mapping qnum 0xb7 to sysrq Historical versions of QEMU allowed both 0x54 and 0xb7 to trigger a print/sysrq key. Although 0x54 is preferred, we must cope with 0xb7 for backwards compat. Signed-off-by: Daniel P. Berrange --- tools/keymap-gen | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/keymap-gen b/tools/keymap-gen index 51f2692..d4594b4 100755 --- a/tools/keymap-gen +++ b/tools/keymap-gen @@ -299,6 +299,12 @@ class Database: self.mapto[self.MAP_QNUM][linux] = qnum self.mapfrom[self.MAP_QNUM][qnum] = linux + # Hack for compatibility with previous mistakes in handling + # Print/SysRq. The preferred qnum for Print/SysRq is 0x54, + # but QEMU previously allowed 0xb7 too + if qnum == 0x54: + self.mapfrom[self.MAP_QNUM][0xb7] = self.mapfrom[self.MAP_QNUM][0x54] + if linux in self.mapname[self.MAP_QCODE]: qcodeenum = self.mapname[self.MAP_QCODE][linux] qcodeenum = "Q_KEY_CODE_" + qcodeenum.upper() -- cgit v1.1