Commit c949e759 authored by Adrian Reber's avatar Adrian Reber Committed by Andrei Vagin

crtools: also print the current kernel version

In addition to writing the CRIU version to the log file this adds the
current kernel version to the log file:

(00.000008) Version: 3.5 (gitid v3.5-511-ga8cc6cf)
(00.000303) Running on node01 Linux 3.10.0-513.el7.x86_64 #1 SMP Tue Feb 29 06:78:90 EST 2017 x86_64

v2:
 - small changes as suggested by Dmitry (thanks)
Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
Reviewed-by: 's avatarDmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent dc384c0e
......@@ -19,6 +19,8 @@
#include <dlfcn.h>
#include <sys/utsname.h>
#include "int.h"
#include "page.h"
#include "common/compiler.h"
......@@ -230,6 +232,20 @@ static void soccr_print_on_level(unsigned int loglevel, const char *format, ...)
va_end(args);
}
static void print_kernel_version(void)
{
struct utsname buf;
if (uname(&buf) < 0) {
pr_perror("Reading kernel version failed!");
/* This pretty unlikely, just keep on running. */
return;
}
pr_info("Running on %s %s %s %s %s\n", buf.nodename, buf.sysname,
buf.release, buf.version, buf.machine);
}
int main(int argc, char *argv[], char *envp[])
{
......@@ -714,6 +730,9 @@ int main(int argc, char *argv[], char *envp[])
compel_log_init(vprint_on_level, log_get_loglevel());
pr_info("Version: %s (gitid %s)\n", CRIU_VERSION, CRIU_GITID);
print_kernel_version();
if (opts.deprecated_ok)
pr_debug("DEPRECATED ON\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment