commit ef86f0fcfc835537f590796d9f076ff9991699bd
Author: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Date:   Wed Feb 10 16:37:57 2010 +0900

    [PATCH] Cleanup: the initialization method is operated if it is possible.
    
    On current code, the initialization method is operated only if
    the method is necessary. That is not wrong, but that is a little
    complex because makedumpfile has many options and there are many
    situations the method is necessary or unnecessary.
    So the initialization method is operated always if it is possible.
    
    Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>

diff -up kexec-tools-2.0.0/makedumpfile-1.3.5/makedumpfile.c.orig kexec-tools-2.0.0/makedumpfile-1.3.5/makedumpfile.c
--- kexec-tools-2.0.0/makedumpfile-1.3.5/makedumpfile.c.orig	2009-11-10 19:44:51.000000000 -0500
+++ kexec-tools-2.0.0/makedumpfile-1.3.5/makedumpfile.c	2010-03-03 10:33:45.000000000 -0500
@@ -3772,6 +3772,8 @@ initialize_bitmap_memory(void)
 int
 initial(void)
 {
+	int debug_info = FALSE;
+
 	if (!(vt.mem_flags & MEMORY_XEN) && info->flag_exclude_xen_dom) {
 		MSG("'-X' option is disable,");
 		MSG("because %s is not Xen's memory core image.\n", info->name_memory);
@@ -3803,6 +3805,7 @@ initial(void)
 		if (!read_vmcoreinfo())
 			return FALSE;
 		close_vmcoreinfo();
+		debug_info = TRUE;
 	/*
 	 * Get the debug information for analysis from the kernel file
 	 */
@@ -3818,6 +3821,8 @@ initial(void)
 
 		if (!get_srcfile_info())
 			return FALSE;
+
+		debug_info = TRUE;
 	} else {
 		/*
 		 * Check whether /proc/vmcore contains vmcoreinfo,
@@ -3847,6 +3852,7 @@ initial(void)
 		if (!read_vmcoreinfo_from_vmcore(info->offset_vmcoreinfo,
 		    info->size_vmcoreinfo, FALSE))
 			return FALSE;
+		debug_info = TRUE;
 	}
 
 	if (!get_value_for_old_linux())
@@ -3863,31 +3869,25 @@ out:
 	if (!get_max_mapnr())
 		return FALSE;
 
-	if ((info->max_dump_level <= DL_EXCLUDE_ZERO) && !info->flag_dmesg) {
-		/*
-		 * The debugging information is unnecessary, because the memory
-		 * management system will not be analazed.
-		 */
-		if (!get_mem_map_without_mm())
+	if (debug_info) {
+		if (!get_machdep_info())
 			return FALSE;
-		else
-			return TRUE;
-	}
 
-	if (!get_machdep_info())
-		return FALSE;
-
-	if (!check_release())
-		return FALSE;
+		if (!check_release())
+			return FALSE;
 
-	if (!get_versiondep_info())
-		return FALSE;
+		if (!get_versiondep_info())
+			return FALSE;
 
-	if (!get_numnodes())
-		return FALSE;
+		if (!get_numnodes())
+			return FALSE;
 
-	if (!get_mem_map())
-		return FALSE;
+		if (!get_mem_map())
+			return FALSE;
+	} else {
+		if (!get_mem_map_without_mm())
+			return FALSE;
+	}
 
 	return TRUE;
 }
