[PATCH] kexec-tools: print error if kexec_file_load fails

Hari Bathini hbathini at linux.ibm.com
Wed Mar 16 03:33:05 PDT 2022


Commit 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error
handling") introduced EFALLBACK for scenarios where fallbacking back
to kexec_load syscall is likely to work and dropped printing error
message for these scenarios. But printing error message for other
failure scenarios was inadvertently dropped. Restore printing error
message for such cases.

Fixes: 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling")
Cc: Petr Tesarik <ptesarik at suse.com>
Reported-by: Nageswara R Sastry <rnsastry at linux.ibm.com>
Tested-by: Nageswara R Sastry <rnsastry at linux.ibm.com>
Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>
---
 kexec/kexec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 7e4787b..865de61 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1339,6 +1339,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
 		case EMSGSIZE:
 			/* Reject by default. */
 		default:
+			fprintf(stderr, "kexec_file_load failed: %s\n", strerror(errno));
 			ret = EFAILED;
 			break;
 
-- 
2.35.1




More information about the kexec mailing list