[CRIU] [PATCH] kerndat: Print host info on startup
Cyrill Gorcunov
gorcunov at openvz.org
Thu Aug 8 16:13:54 EDT 2013
When people report us bug error we prefer
to know which kernel version the criu is
running on. So add this kind of information
into debug output.
| Linux 3.9.11-200.fc18.x86_64 #1 SMP Mon Jul 22 21:04:50 UTC 2013 x86_64
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
kerndat.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/kerndat.c b/kerndat.c
index 89d00fd..79b2dbb 100644
--- a/kerndat.c
+++ b/kerndat.c
@@ -4,6 +4,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
+#include <sys/utsname.h>
#include <errno.h>
#include "log.h"
@@ -100,10 +101,28 @@ int kerndat_get_dirty_track(void)
return 0;
}
+static void kerndat_uname_init(void)
+{
+ struct utsname utsname;
+
+ if (uname(&utsname)) {
+ pr_perror("Can't fetch node information");
+ return;
+ }
+
+ pr_debug("%s %s %s %s\n",
+ utsname.sysname,
+ utsname.release,
+ utsname.version,
+ utsname.machine);
+}
+
int kerndat_init(void)
{
int ret;
+ kerndat_uname_init();
+
ret = kerndat_get_shmemdev();
if (!ret)
ret = kerndat_get_dirty_track();
--
1.8.1.4
More information about the CRIU
mailing list