Commit bdb58423 authored by Kinsbursky Stanislav's avatar Kinsbursky Stanislav Committed by Pavel Emelyanov

protobuf: use generic show function for pipe data

Signed-off-by: 's avatarStanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9ac6d091
...@@ -81,24 +81,16 @@ void show_ghost_file(int fd, struct cr_options *o) ...@@ -81,24 +81,16 @@ void show_ghost_file(int fd, struct cr_options *o)
pb_show_vertical(fd, ghost_file_entry); pb_show_vertical(fd, ghost_file_entry);
} }
void __show_pipes_data(int fd, struct cr_options *o) static void pipe_data_handler(int fd, void *obj)
{ {
PipeDataEntry *e; PipeDataEntry *e = obj;
pr_msg("\n");
while (1) { print_image_data(fd, e->bytes);
if (pb_read_eof(fd, &e, pipe_data_entry) <= 0)
break;
pr_msg("pipeid: 0x%8x bytes: 0x%8x\n", e->pipe_id, e->bytes);
lseek(fd, e->bytes, SEEK_CUR);
pipe_data_entry__free_unpacked(e, NULL);
}
} }
void show_pipes_data(int fd_pipes, struct cr_options *o) void show_pipes_data(int fd, struct cr_options *o)
{ {
pr_img_head(CR_FD_PIPES_DATA); pb_show_plain_payload(fd, pipe_data_entry, pipe_data_handler);
__show_pipes_data(fd_pipes, o);
pr_img_tail(CR_FD_PIPES_DATA);
} }
void show_pipes(int fd_pipes, struct cr_options *o) void show_pipes(int fd_pipes, struct cr_options *o)
...@@ -108,9 +100,7 @@ void show_pipes(int fd_pipes, struct cr_options *o) ...@@ -108,9 +100,7 @@ void show_pipes(int fd_pipes, struct cr_options *o)
void show_fifo_data(int fd, struct cr_options *o) void show_fifo_data(int fd, struct cr_options *o)
{ {
pr_img_head(CR_FD_FIFO_DATA); show_pipes_data(fd, o);
__show_pipes_data(fd, o);
pr_img_tail(CR_FD_FIFO_DATA);
} }
void show_fifo(int fd, struct cr_options *o) void show_fifo(int fd, struct cr_options *o)
......
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