mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
[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:
1 parent
e46a19a35a
commit
a7c31ee80e
1 file changed
+11
-3
+11
-3
@@ -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);
|
||||
|
||||