[CRIU] [PATCH 3/6] fown: add protobuf "pretty show" array
Kinsbursky Stanislav
skinsbursky at openvz.org
Fri Jul 27 10:06:40 EDT 2012
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
cr-show.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/cr-show.c b/cr-show.c
index 9e1db5a..a9f7a67 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -66,6 +66,39 @@ void show_fown_cont(void *p)
fown->uid, fown->euid, fown->signum, fown->pid_type, fown->pid);
}
+static void show_fown_uid(void *ptr, void *arg)
+{
+ pr_msg("uid: %#x ", *(unsigned int *)ptr);
+}
+
+static void show_fown_euid(void *ptr, void *arg)
+{
+ pr_msg("euid: %#x ", *(unsigned int *)ptr);
+}
+
+static void show_fown_signum(void *ptr, void *arg)
+{
+ pr_msg("signum: %#x ", *(unsigned int *)ptr);
+}
+
+static void show_fown_pid_type(void *ptr, void *arg)
+{
+ pr_msg("pid_type: %#x ", *(unsigned int *)ptr);
+}
+
+static void show_fown_pid(void *ptr, void *arg)
+{
+ pr_msg("pid: %u\n", *(unsigned int *)ptr);
+}
+
+pb_pr_field_t fown_pretty_array[] = {
+ [0] = show_fown_uid,
+ [1] = show_fown_euid,
+ [2] = show_fown_signum,
+ [3] = show_fown_pid_type,
+ [4] = show_fown_pid,
+};
+
void show_reg_files(int fd_reg_files, struct cr_options *o)
{
pb_show_plain(fd_reg_files, reg_file_entry);
More information about the CRIU
mailing list