ia64/xen-unstable

changeset 12996:de69059a1f0e

[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>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Dec 13 11:29:09 2006 +0000 (2006-12-13)
parents 3c7a6081f1a9
children 478ddc354ccd
files xen/common/kexec.c
line diff
     1.1 --- a/xen/common/kexec.c	Wed Dec 13 10:05:07 2006 +0000
     1.2 +++ b/xen/common/kexec.c	Wed Dec 13 11:29:09 2006 +0000
     1.3 @@ -140,13 +140,21 @@ void machine_crash_kexec(void)
     1.4  
     1.5  static void do_crashdump_trigger(unsigned char key)
     1.6  {
     1.7 -	printk("triggering crashdump\n");
     1.8 -	machine_crash_kexec();
     1.9 +    int pos = (test_bit(KEXEC_FLAG_CRASH_POS, &kexec_flags) != 0);
    1.10 +    if ( test_bit(KEXEC_IMAGE_CRASH_BASE + pos, &kexec_flags) )
    1.11 +    {
    1.12 +        printk("'%c' pressed -> triggering crashdump\n", key);
    1.13 +        machine_crash_kexec();
    1.14 +    }
    1.15 +    else
    1.16 +    {
    1.17 +        printk("'%c' pressed -> no crash kernel loaded -- not triggering crashdump\n", key);
    1.18 +    }
    1.19  }
    1.20  
    1.21  static __init int register_crashdump_trigger(void)
    1.22  {
    1.23 -	register_keyhandler('c', do_crashdump_trigger, "trigger a crashdump");
    1.24 +	register_keyhandler('C', do_crashdump_trigger, "trigger a crashdump");
    1.25  	return 0;
    1.26  }
    1.27  __initcall(register_crashdump_trigger);