Skip to contentSkip to conversation

allow ^O through console when doubled

PATCH Ben Pfaff 1 participant 1 message Mar 10, 2007

lore
Share & tools
lore

Ben Pfaff

author
#0 lore raw

The Xen console intercepts ^O and prevents it from propagating through to the guest. However, ^O is a useful key in bash and in Emacs. This patch changes the console to pass a single ^O through to the guest when it is pressed twice.

linux-2.6-xen-sparse/drivers/xen/console/console.c +5 -2
diff -r 6e03c621b579 -r b377228321f6 linux-2.6-xen-sparse/drivers/xen/console/console.c
@@ -348,8 +348,11 @@ void xencons_rx(char *buf, unsigned len,
 #ifdef CONFIG_MAGIC_SYSRQ
 		if (sysrq_enabled) {
 			if (buf[i] == '\x0f') { /* ^O */
-				sysrq_requested = jiffies;
-				continue; /* don't print the sysrq key */
+				if (!sysrq_requested) {
+					sysrq_requested = jiffies;
+					continue; /* don't print the sysrq key */
+				}
+				sysrq_requested = 0;
 			} else if (sysrq_requested) {
 				unsigned long sysrq_timeout =
 					sysrq_requested + HZ*2;
Signature · 3 lines
Ben Pfaff 
[email protected]
http://benpfaff.org