Commit 824403a0 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

crtools: create new header for servicefd stuff (v2)

v2: generate patch relative to the official git.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9826d2dd
......@@ -36,6 +36,7 @@
#include "kcmp-ids.h"
#include "compiler.h"
#include "crtools.h"
#include "servicefd.h"
#include "syscall.h"
#include "ptrace.h"
#include "util.h"
......
......@@ -29,6 +29,7 @@
#include "asm/types.h"
#include "asm/restorer.h"
#include "servicefd.h"
#include "image.h"
#include "util.h"
#include "util-pie.h"
......
......@@ -10,6 +10,7 @@
#include "image.h"
#include "lock.h"
#include "cr-show.h"
#include "servicefd.h"
#include "protobuf/vma.pb-c.h"
......@@ -50,34 +51,7 @@ extern struct cr_options opts;
extern void init_opts(void);
enum sfd_type {
SERVICE_FD_MIN,
LOG_FD_OFF,
LOG_DIR_FD_OFF,
IMG_FD_OFF,
PROC_FD_OFF, /* fd with /proc for all proc_ calls */
CTL_TTY_OFF,
SELF_STDIN_OFF,
PARENT_FD_OFF,
CR_PROC_FD_OFF, /* some other's proc fd.
* For dump -- target ns' proc
* For restore -- CRIU ns' proc
*/
SERVICE_FD_MAX
};
#define CR_PARENT_LINK "parent"
extern int clone_service_fd(int id);
extern int init_service_fd(void);
extern int get_service_fd(enum sfd_type type);
extern int reserve_service_fd(enum sfd_type type);
extern int install_service_fd(enum sfd_type type, int fd);
extern int close_service_fd(enum sfd_type type);
extern bool is_service_fd(int fd, enum sfd_type type);
extern bool is_any_service_fd(int fd);
#define CR_PARENT_LINK "parent"
int check_img_inventory(void);
int write_img_inventory(void);
......
#ifndef __CR_SERVICE_FD_H__
#define __CR_SERVICE_FD_H__
enum sfd_type {
SERVICE_FD_MIN,
LOG_FD_OFF,
LOG_DIR_FD_OFF,
IMG_FD_OFF,
PROC_FD_OFF, /* fd with /proc for all proc_ calls */
CTL_TTY_OFF,
SELF_STDIN_OFF,
PARENT_FD_OFF,
CR_PROC_FD_OFF, /* some other's proc fd.
* For dump -- target ns' proc
* For restore -- CRIU ns' proc
*/
SERVICE_FD_MAX
};
extern int clone_service_fd(int id);
extern int init_service_fd(void);
extern int get_service_fd(enum sfd_type type);
extern int reserve_service_fd(enum sfd_type type);
extern int install_service_fd(enum sfd_type type, int fd);
extern int close_service_fd(enum sfd_type type);
extern bool is_service_fd(int fd, enum sfd_type type);
extern bool is_any_service_fd(int fd);
#endif
......@@ -16,6 +16,7 @@
#include "asm/types.h"
#include "util.h"
#include "crtools.h"
#include "servicefd.h"
#define DEFAULT_LOGFD STDERR_FILENO
......
......@@ -4,6 +4,7 @@
#include <errno.h>
#include "crtools.h"
#include "servicefd.h"
#include "mem.h"
#include "parasite-syscall.h"
#include "parasite.h"
......
......@@ -3,6 +3,7 @@
#include <unistd.h>
#include "crtools.h"
#include "servicefd.h"
#include "page-read.h"
#include "protobuf.h"
......
......@@ -18,6 +18,7 @@
#include "syscall.h"
#include "files.h"
#include "crtools.h"
#include "servicefd.h"
#include "image.h"
#include "util.h"
#include "log.h"
......
......@@ -38,6 +38,7 @@
#include "rst-malloc.h"
#include "crtools.h"
#include "servicefd.h"
#define VMA_OPT_LEN 128
......
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