[CRIU] [PATCH 06/14] crtools: add a callback to show signal=*.img
Andrey Vagin
avagin at openvz.org
Thu Jan 17 09:38:30 EST 2013
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 57bdbef..de9d84e 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
@@ -242,6 +243,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 86c55af..8d1000a 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -154,6 +154,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