[CRIU] [PATCH 04/12] crtools: add a callback to show signal=*.img
Andrey Vagin
avagin at openvz.org
Tue Dec 18 01:36:07 EST 2012
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
cr-show.c | 23 +++++++++++++++++++++++
include/crtools.h | 1 +
2 files changed, 24 insertions(+)
diff --git a/cr-show.c b/cr-show.c
index 48031f8..221726e 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -42,6 +42,7 @@
#include "protobuf/creds.pb-c.h"
#include "protobuf/core.pb-c.h"
#include "protobuf/tty.pb-c.h"
+#include "protobuf/siginfo.pb-c.h"
#define DEF_PAGES_PER_LINE 6
@@ -241,6 +242,28 @@ out:
pr_img_tail(CR_FD_PAGES);
}
+void show_siginfo(int fd, struct cr_options *o)
+{
+ int ret;
+
+ pr_img_head(CR_FD_SIGNAL);
+ while (1) {
+ SiginfoEntry *sie;
+ siginfo_t *info;
+
+ ret = pb_read_one_eof(fd, &sie, PB_SIGINFO);
+ if (ret <= 0)
+ break;
+
+ info = (siginfo_t *) sie->siginfo.data;
+ pr_msg("signal: si_signo=%d si_code=%x\n",
+ info->si_signo, info->si_code);
+ siginfo_entry__free_unpacked(sie, NULL);
+
+ }
+ pr_img_tail(CR_FD_SIGNAL);
+}
+
void show_sigacts(int fd_sigacts, struct cr_options *o)
{
pb_show_plain(fd_sigacts, PB_SIGACT);
diff --git a/include/crtools.h b/include/crtools.h
index faef472..eb7013b 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -146,6 +146,7 @@ void show_fifo(int fd, struct cr_options *o);
void show_fifo_data(int fd_pipes, struct cr_options *o);
void show_pstree(int fd_pstree, struct cr_options *o);
void show_sigacts(int fd_sigacts, struct cr_options *o);
+void show_siginfo(int fd, struct cr_options *o);
void show_itimers(int fd, struct cr_options *o);
void show_creds(int fd, struct cr_options *o);
void show_fs(int fd, struct cr_options *o);
--
1.7.11.7
More information about the CRIU
mailing list