[XEN] Kexec: Disable crash keyhandler when no crash kernel is loaded.

Also make the crash dump key capital-C rather than lowercase to make it harder
to hit by mistake.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
This commit is contained in:
Ian Campbell committed 2006-12-13 11:29:09 +00:00
1 parent e46a19a35a
commit a7c31ee80e
1 file changed
+11 -3
+11 -3
View File
@@ -140,13 +140,21 @@ void machine_crash_kexec(void)
static void do_crashdump_trigger(unsigned char key)
{
printk("triggering crashdump\n");
machine_crash_kexec();
int pos = (test_bit(KEXEC_FLAG_CRASH_POS, &kexec_flags) != 0);
if ( test_bit(KEXEC_IMAGE_CRASH_BASE + pos, &kexec_flags) )
{
printk("'%c' pressed -> triggering crashdump\n", key);
machine_crash_kexec();
}
else
{
printk("'%c' pressed -> no crash kernel loaded -- not triggering crashdump\n", key);
}
}
static __init int register_crashdump_trigger(void)
{
register_keyhandler('c', do_crashdump_trigger, "trigger a crashdump");
register_keyhandler('C', do_crashdump_trigger, "trigger a crashdump");
return 0;
}
__initcall(register_crashdump_trigger);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.