criu/include/pipes.h
Andrey Vagin 0fc129a121 files: pass a file descriptor on an fdinfo image instead of cr_fdset
Currently fdinfo dumps for each task, so CR_FD_FDINFO is in cr_fdset.
A few tasks can share one fd table and the set of descriptors will be
dumped once and a image name will contain files_id instead of pid.
In this case CR_FD_FDINFO will go away from cr_fdset.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-11 14:47:09 +04:00

39 lines
951 B
C

#ifndef __CR_PIPES_H__
#define __CR_PIPES_H__
#include "../protobuf/pipe-data.pb-c.h"
extern int collect_pipes(void);
extern void mark_pipe_master(void);
int dump_pipe(struct fd_parms *p, int lfd,
const int fdinfo);
static inline u32 pipe_id(const struct fd_parms *p)
{
return p->stat.st_ino;
}
#define NR_PIPES_WITH_DATA 1024
struct pipe_data_dump {
int img_type;
unsigned int nr;
u32 ids[NR_PIPES_WITH_DATA];
};
extern int dump_one_pipe_data(struct pipe_data_dump *pd, int lfd, const struct fd_parms *p);
struct pipe_data_rst {
PipeDataEntry *pde;
void *data;
struct pipe_data_rst *next;
};
#define PIPE_DATA_HASH_BITS 5
#define PIPE_DATA_HASH_SIZE (1 << PIPE_DATA_HASH_BITS)
#define PIPE_DATA_HASH_MASK (PIPE_DATA_HASH_SIZE - 1)
extern int collect_pipe_data(int img_type, struct pipe_data_rst **hash);
extern int restore_pipe_data(int img_type, int pfd, u32 id, struct pipe_data_rst **hash);
#endif /* __CR_PIPES_H__ */