mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 07:45:17 +00:00
protobuf: use generic show function for pipe data
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
9ac6d09149
commit
bdb58423ca
24
cr-show.c
24
cr-show.c
@@ -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)
|
|||||||
|
|
||||||
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)
|
||||||
|
Reference in New Issue
Block a user