From: Glenn Washburn <development@efficientek.com>
To: linux-um <linux-um@lists.infradead.org>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH 4/4] um: run_helper: Write error message to kernel log on exec failure on host
Date: Thu, 3 Mar 2022 01:53:33 -0600 [thread overview]
Message-ID: <94ce8a8b0cac5c5142b802c4e777b2aaa8a1e682.1646292328.git.development@efficientek.com> (raw)
In-Reply-To: <cover.1646292328.git.development@efficientek.com>
The best place to log errors from the host side is in the kernel log within
the UML guest. Letting the user now that exec() failed and why is very
helpful when the user is trying to determine why some aspect of UML is not
working. For instance, when telneting into the UML instance, if the
connection is established and then immediately dropped, this may be due to
exec() failing because in.telnetd is not found.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
arch/um/os-Linux/helper.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c
index 32e88baf18dd..b459745f52e2 100644
--- a/arch/um/os-Linux/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -4,6 +4,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sched.h>
@@ -99,6 +100,10 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
CATCH_EINTR(waitpid(pid, NULL, __WALL));
}
+ if (ret < 0)
+ printk(UM_KERN_ERR "run_helper : failed to exec %s on host: %s\n",
+ argv[0], strerror(-ret));
+
out_free2:
kfree(data.buf);
out_close:
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
prev parent reply other threads:[~2022-03-03 7:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 7:53 [PATCH 0/4] Improvements to port on various error conditions Glenn Washburn
2022-03-03 7:53 ` [PATCH 1/4] um: port_user: Search for in.telnetd in PATH Glenn Washburn
2022-03-03 7:53 ` [PATCH 2/4] um: port_user: Allow setting path to port-helper using UML_PORT_HELPER envvar Glenn Washburn
2022-03-03 7:53 ` [PATCH 3/4] um: port_user: Improve error handling when port-helper is not found Glenn Washburn
2022-03-03 7:53 ` Glenn Washburn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94ce8a8b0cac5c5142b802c4e777b2aaa8a1e682.1646292328.git.development@efficientek.com \
--to=development@efficientek.com \
--cc=linux-um@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.