mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
lib: Print kernel utsname in debug output
Useful for debugging problems caused by the host kernel. In particular we were looking at a problem with passt creating a user namespace but didn't know what exact kernel was being used.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/wait.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
@@ -93,6 +94,7 @@ guestfs_impl_launch (guestfs_h *g)
|
||||
struct backend *b;
|
||||
CLEANUP_FREE char *backend = guestfs_get_backend (g);
|
||||
int mask;
|
||||
struct utsname utsname;
|
||||
|
||||
debug (g, "launch: program=%s", g->program);
|
||||
if (STRNEQ (g->identifier, ""))
|
||||
@@ -109,6 +111,10 @@ guestfs_impl_launch (guestfs_h *g)
|
||||
if (mask >= 0)
|
||||
debug (g, "launch: umask=0%03o", (unsigned) mask);
|
||||
debug (g, "launch: euid=%ju", (uintmax_t) geteuid ());
|
||||
if (uname (&utsname) == 0)
|
||||
debug (g, "launch: host: %s %s %s %s %s",
|
||||
utsname.sysname, utsname.nodename, utsname.release,
|
||||
utsname.version, utsname.machine);
|
||||
}
|
||||
|
||||
/* Launch the appliance. */
|
||||
|
||||
Reference in New Issue
Block a user