This site is now 100% read-only, and retired.

XML logo

Magic SysRq to xen's dom0 on a serial console
Posted by dkg on Fri 11 May 2007 at 02:34
For a normal server running with the kernel console over a serial line, you can get Magic SysRq behavior by sending a "break" signal, followed by the character of the command you want triggered. How does that work for dom0 of a Xen install?

I've just set up a xen server which is running the hypervisor and dom0 over the serial line, using debian etch xen support. I'm finding that i can't use my typical break-character sequence to get the SysRq effect on dom0. If i boot the machine without the xen hypervisor (standard 686 kernel) the break-character sequence works fine.

I'm having a hard time searching for this, because a lot of posts have been made about sending Magic SysRq signals to domUs, and what i'm looking for seems to be lost in the noise.

I confess i'm also not sure who should handle the Magic SysRq: should the hypervisor handle it and pass it off to the dom0 kernel? Or does the dom0 kernel handle it and hand it off to the hypervisor? confusing...

Here's my grub stanza for the machine:

title           Xen 3.0.3-1-i386-pae / Debian GNU/Linux, kernel 2.6.18-4-xen-686
root            (hd0,0)
kernel          /xen-3.0.3-1-i386-pae.gz dom0_mem=131072 com1=115200,8n1
module          /vmlinuz-2.6.18-4-xen-686 root=/dev/mapper/vg_monkey0-dom0 ro console=ttyS0,115200n8 
module          /initrd.img-2.6.18-4-xen-686
savedefault
and /proc/sys/kernel/sysrq is already set to 1. Anyone have any ideas what i should do to be able to re-enable this life-saving feature? I know if my dom0 needs this kind of thing, i'm in bad shape already. But that's exactly the time when i'll want it!

 

Comments on this Entry

Re: Magic SysRq to xen's dom0 on a serial console
Posted by Anonymous (59.162.xx.xx) on Thu 13 Dec 2007 at 21:54
For Xen looks like the escape code is ^O. Try using: CTRL-O h on the
Dom0 mode on the Xen console.

Btw, your comment was a great help in figuring out where to look.
Thanks.

Ankur

[ Parent ]

Re: Magic SysRq to xen's dom0 on a serial console
Posted by dkg (216.254.xx.xx) on Thu 13 Dec 2007 at 22:41
[ View Weblogs ]
Thanks so much! That works for me, directly from the physical serial console to send a SysRq to the dom0. Would you mind linking to where you found this information?

Thanks again for the followup!

[ Parent ]

Re: Magic SysRq to xen's dom0 on a serial console
Posted by dkg (216.254.xx.xx) on Thu 13 Dec 2007 at 22:45
[ View Weblogs ]
Interesting; i just realized that's the same escape character you can send to the domU from the dom0.

There's a nice clean parallel there between the serial console of the dom0 and an xm console fubar linking to the console of the fubar domU.

[ Parent ]

Re: Magic SysRq to xen's dom0 on a serial console
Posted by Anonymous (59.162.xx.xx) on Thu 13 Dec 2007 at 23:37
Originally when I was hunting for this I was looking at the linux serial driver code. Predictably was having no luck there. After reading your question, I realised that I needed to look at the linux xen console code. And, that's where it was hiding.

The relevant code is in drivers/xen/console.c (line 338). You can see it here:
http://xenbits.xensource.com/linux-2.6.18-xen.hg?file/52f308b17ba e/drivers/xen/console/console.c

Ankur

[ Parent ]

Re: Magic SysRq to xen's dom0 on a serial console
Posted by Anonymous (87.230.xx.xx) on Thu 30 Oct 2008 at 14:01
That is awesome... and saved me about 40 bucks for an unsheduled remote reboot.

Thank your SO much,

Joel 'gibbon_' Garske

[ Parent ]