diff options
author | Mohan Kumar M <mohan@in.ibm.com> | 2006-10-09 14:55:58 +0530 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-10-13 16:04:16 +0900 |
commit | 878e1322daaa34e1b33825642a33d0a027a5d373 (patch) | |
tree | 927638a98ca5dadd209479422861021d19cb9ca9 | |
parent | 13882ab8fd1261c378de648bbcc1ed21822a2121 (diff) |
Check for crashkernel memory reservation
Check whether memory for crashkernel is reserved by calling arch dependent
functions. The patch also creates dummy functions in ppc, ia64 and s390
architectures, so that the build process will not break. The function
"is_crashkernel_mem_reserved" needs to be implemented on ppc, ia64 and
s390 architectures.
Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/ia64/crashdump-ia64.c | 9 | ||||
-rw-r--r-- | kexec/arch/ppc/kexec-ppc.c | 8 | ||||
-rw-r--r-- | kexec/arch/s390/kexec-s390.c | 9 | ||||
-rw-r--r-- | kexec/kexec.c | 7 | ||||
-rw-r--r-- | kexec/kexec.h | 1 |
5 files changed, 33 insertions, 1 deletions
diff --git a/kexec/arch/ia64/crashdump-ia64.c b/kexec/arch/ia64/crashdump-ia64.c index d2d20af..39cd4f1 100644 --- a/kexec/arch/ia64/crashdump-ia64.c +++ b/kexec/arch/ia64/crashdump-ia64.c @@ -348,4 +348,11 @@ int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr, return 0; } - +/* + * Adding a dummy function, so that build on IA64 will not break. + * Need to implement the actual checking code + */ +int is_crashkernel_mem_reserved(void) +{ + return 1; +} diff --git a/kexec/arch/ppc/kexec-ppc.c b/kexec/arch/ppc/kexec-ppc.c index 16ea584..f42b434 100644 --- a/kexec/arch/ppc/kexec-ppc.c +++ b/kexec/arch/ppc/kexec-ppc.c @@ -149,3 +149,11 @@ void arch_update_purgatory(struct kexec_info *info) { } +/* + * Adding a dummy function, so that build on PPC will not break. + * Need to implement the actual checking code + */ +int is_crashkernel_mem_reserved(void) +{ + return 1; +} diff --git a/kexec/arch/s390/kexec-s390.c b/kexec/arch/s390/kexec-s390.c index e90ae93..b778620 100644 --- a/kexec/arch/s390/kexec-s390.c +++ b/kexec/arch/s390/kexec-s390.c @@ -102,3 +102,12 @@ int arch_compat_trampoline(struct kexec_info *info) void arch_update_purgatory(struct kexec_info *info) { } + +/* + * Adding a dummy function, so that build on s390 will not break. + * Need to implement the actual checking code + */ +int is_crashkernel_mem_reserved(void) +{ + return 1; +} diff --git a/kexec/kexec.c b/kexec/kexec.c index ce0663e..204a4b8 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -848,6 +848,13 @@ int main(int argc, char *argv[]) } } + if ((kexec_flags & KEXEC_ON_CRASH) && !is_crashkernel_mem_reserved()) { + printf("Memory for crashkernel is not reserved\n"); + printf("Please reserve memory by passing "); + printf("\"crashkernel=X@Y\" parameter to the kernel\n"); + die("Then try loading kdump kernel\n"); + } + fileind = optind; /* Reset getopt for the next pass; called in other source modules */ opterr = 1; diff --git a/kexec/kexec.h b/kexec/kexec.h index 1cee900..d6942bf 100644 --- a/kexec/kexec.h +++ b/kexec/kexec.h @@ -199,6 +199,7 @@ void arch_usage(void); int arch_process_options(int argc, char **argv); int arch_compat_trampoline(struct kexec_info *info); void arch_update_purgatory(struct kexec_info *info); +int is_crashkernel_mem_reserved(void); #define MAX_LINE 160 #endif /* KEXEC_H */ |