Skip to contentSkip to conversation

fix error case of xen

PATCH In review Akio Takebe 2 participants 6 messages Mar 31, 2008 – Apr 2, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix error case of xen

Hi,

Curret kdump-xen with makdumpfile always return 0. So if we fail to kdump, we will get $?=0. This patch improve it.

makedumpfile.c +4 -1
@@ -993,6 +993,8 @@ get_symbol_addr(char *symname)
 		if (!strcmp(sym_name, symname)) {
 			symbol = sym.st_value;
 			break;
+		} else if (i >= (shdr.sh_size/shdr.sh_entsize)-1) {
+			DEBUG_MSG("Can't get symbol of %s.\n", symname);
 		}
 	}
 out:
@@ -6146,7 +6148,8 @@ main(int argc, char *argv[])
 			goto out;
 		}
 		info->dump_level |= DL_EXCLUDE_XEN;
-		return handle_xen();
+		if (!handle_xen())
+			goto out;
 
 	} else if (info->flag_rearrange) {
 		if (!open_files_for_rearranging_dumpdata())

Best Regards,

Akio Takebe

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw

Hi Takebe-san,

Thank you for the patch.

Quoted 9 lines · Akio Takebe

Curret kdump-xen with makdumpfile always return 0. So if we fail to kdump, we will get $?=0. This patch improve it.

makedumpfile.c get_symbol_addr(char *symname) · line 997

Quoted 5 lines
makedumpfile.c +2 -0
@@ -993,6 +993,8 @@ get_symbol_addr(char *symname)
 		if (!strcmp(sym_name, symname)) {
 			symbol = sym.st_value;
 			break;
+		} else if (i >= (shdr.sh_size/shdr.sh_entsize)-1) {
+			DEBUG_MSG("Can't get symbol of %s.\n", symname);

This patch is for fixing error code of xen, but the above code adds the debugging message. So the above code doesn't match its purpose. Is it necessary ?

makedumpfile.c get_symbol_addr(char *symname) · line 999

Quoted 3 lines
makedumpfile.c +2 -1
-		return handle_xen();
+		if (!handle_xen())
+			goto out;

I guess that the above code is not enough. If handle_xen() succeeds, it should return TRUE instead of COMPLETED like the attached patch, right ?

Thanks
Ken'ichi Ohmichi

---

makedumpfile.c renamed from v1.2.5/makedumpfile.c +3 -2
diff -puN backup/v1.2.5/makedumpfile.c makedumpfile/makedumpfile.c
@@ -5855,7 +5855,7 @@ handle_xen()
 	MSG("\n");
 	MSG("The dumpfile is saved to %s.\n", info->name_dumpfile);
 
-	return COMPLETED;
+	return TRUE;
 out:
 	return FALSE;
 #endif
@@ -6146,7 +6146,8 @@ main(int argc, char *argv[])
 			goto out;
 		}
 		info->dump_level |= DL_EXCLUDE_XEN;
-		return handle_xen();
+		if (!handle_xen())
+			goto out;
 
 	} else if (info->flag_rearrange) {
 		if (!open_files_for_rearranging_dumpdata())

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw

Hi Takebe-san,

Quoted 11 lines · Ken'ichi Ohmichi

Hi Takebe-san,

Thank you for the patch.

Quoted 6 lines · Akio Takebe

Curret kdump-xen with makdumpfile always return 0. So if we fail to kdump, we will get $?=0. This patch improve it.

Quoted 12 lines

makedumpfile.c get_symbol_addr(char *symname) · line 997

Quoted 8 lines
makedumpfile.c +2 -0
@@ -993,6 +993,8 @@ get_symbol_addr(char *symname)
 		if (!strcmp(sym_name, symname)) {
 			symbol = sym.st_value;
 			break;
+		} else if (i >= (shdr.sh_size/shdr.sh_entsize)-1) {
+			DEBUG_MSG("Can't get symbol of %s.\n", symname);

This patch is for fixing error code of xen, but the above code adds the debugging message. So the above code doesn't match its purpose. Is it necessary ?

Sorry for incomprehensible comment.

The existences of symbols depend on linux version, cpu architecture, and linux configuration (.config file). If the above code is merged, the debugging message will be big and unreadable.
Do you want to know the lacks of necessary symbol for dump filtering of Xen ? -D option prints them.

Thanks
Ken'ichi Ohmichi

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw

Hi, Ohmichi-san

Thank you for your review.

Quoted 20 lines
Quoted 7 lines
Quoted 6 lines · Akio Takebe

Curret kdump-xen with makdumpfile always return 0. So if we fail to kdump, we will get $?=0. This patch improve it.

Quoted 12 lines

makedumpfile.c get_symbol_addr(char *symname) · line 997

Quoted 8 lines
makedumpfile.c +2 -0
@@ -993,6 +993,8 @@ get_symbol_addr(char *symname)
 		if (!strcmp(sym_name, symname)) {
 			symbol = sym.st_value;
 			break;
+		} else if (i >= (shdr.sh_size/shdr.sh_entsize)-1) {
+			DEBUG_MSG("Can't get symbol of %s.\n", symname);

This patch is for fixing error code of xen, but the above code adds the debugging message. So the above code doesn't match its purpose. Is it necessary ?

Quoted 8 lines

Sorry for incomprehensible comment.

The existences of symbols depend on linux version, cpu architecture, and linux configuration (.config file). If the above code is merged, the debugging message will be big and unreadable.
Do you want to know the lacks of necessary symbol for dump filtering of Xen ? -D option prints them.

Yes, that's right.
The concept of this hunk is to catch error at making vmcoreinfo file. Current vmcoreinfo doesn't show error if some necessary symbols are not included. Then we will find it at failing kdump.
So I wanted to add the debug message into the function finding symbol. Since the hunk is not important, please drop it.

Best Regards,

Akio Takebe

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw
In reply to Ken'ichi Ohmichi

Hi, Ohmichi-san

Quoted 7 lines

makedumpfile.c main(int argc, char *argv[]) · line 6150

Quoted 4 lines
makedumpfile.c renamed from v1.2.5/makedumpfile.c +2 -1
-		return handle_xen();
+		if (!handle_xen())
+			goto out;

I guess that the above code is not enough. If handle_xen() succeeds, it should return TRUE instead of COMPLETED like the attached patch, right ?

You're right!
Your patch looks good, thank you very much for your review.

Best Regards,

Akio Takebe

Quoted 21 lines

Thanks
Ken'ichi Ohmichi

---
diff -puN backup/v1.2.5/makedumpfile.c makedumpfile/makedumpfile.c

makedumpfile.c renamed from v1.2.5/makedumpfile.c +1 -1
@@ -5855,7 +5855,7 @@ handle_xen()
 	MSG("\n");
 	MSG("The dumpfile is saved to %s.\n", info->name_dumpfile);
 
-	return COMPLETED;
+	return TRUE;

out:

	return FALSE;

#endif

makedumpfile.c main(int argc, char *argv[]) · line 6153

Quoted 9 lines
makedumpfile.c renamed from v1.2.5/makedumpfile.c +2 -1
@@ -6146,7 +6146,8 @@ main(int argc, char *argv[])
 			goto out;
 		}
 		info->dump_level |= DL_EXCLUDE_XEN;
-		return handle_xen();
+		if (!handle_xen())
+			goto out;
 
 	} else if (info->flag_rearrange) {
 		if (!open_files_for_rearranging_dumpdata())

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw

Hi Takebe-san,

Quoted 5 lines · Akio Takebe
Quoted 2 lines

I guess that the above code is not enough. If handle_xen() succeeds, it should return TRUE instead of COMPLETED like the attached patch, right ?

You're right!
Your patch looks good, thank you very much for your review.

Thank you for the comment.
I'll release the next makedumpfile which includes it.

Thanks
Ken'ichi Ohmichi

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec