Files
hyperstart/src/container.h
T
Gao feng a8362c1a70 hold the fd of container pts device in hyper init
1, Hold the the file description of pts device and ptmx in hyper-init process
2, Dup fd to the stdio of Exec cmd
3, Exec cmd exited, no EPOLLHUP event since the file is still open
4, Try to read ptmx fd before close pts fd
4, signal handler get signal SIGCHLD, close the pts fd to trigger EPOLLHUP event
5, EPOLLHUP event is received, send eof message to ttyfd. release exec.

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
2015-09-23 10:56:49 +08:00

49 lines
803 B
C

#ifndef _CONTAINER_H_
#define _CONTAINER_H_
#include "exec.h"
struct env {
char *env;
char *value;
};
struct volume {
char *device;
char *mountpoint;
char *fstype;
int readonly;
};
struct fsmap {
char *source;
char *path;
int readonly;
};
struct hyper_container {
char *id;
char *rootfs;
char *image;
char *workdir;
char *fstype;
struct volume *vols;
struct env *envs;
struct fsmap *maps;
int vols_num;
int envs_num;
int maps_num;
int ns;
uint32_t code;
struct hyper_exec exec;
};
struct hyper_pod;
int hyper_start_container(struct hyper_container *container,
int utsns, int ipcns, struct hyper_pod *pod);
struct hyper_container *hyper_find_container(struct hyper_pod *pod, char *id);
void hyper_cleanup_container(struct hyper_pod *pod);
#endif