2013-11-06 17:21:11 +04:00
|
|
|
#ifndef __CR_OPTIONS_H__
|
|
|
|
#define __CR_OPTIONS_H__
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "list.h"
|
|
|
|
|
2014-01-31 13:05:44 +04:00
|
|
|
/*
|
|
|
|
* CPU capability options.
|
|
|
|
*/
|
2014-09-30 21:18:45 +04:00
|
|
|
#define CPU_CAP_NONE (0u)
|
2014-01-31 13:05:44 +04:00
|
|
|
#define CPU_CAP_ALL (-1u)
|
2014-09-30 21:18:45 +04:00
|
|
|
#define CPU_CAP_FPU (1u) /* Only FPU capability required */
|
2014-12-17 16:48:00 +03:00
|
|
|
#define CPU_CAP_CPU (2u) /* Strict CPU capability required */
|
|
|
|
#define CPU_CAP_INS (4u) /* Instructions CPU capatibility */
|
2014-09-30 21:18:45 +04:00
|
|
|
#define CPU_CAP_DEFAULT (CPU_CAP_FPU)
|
2014-01-31 13:05:44 +04:00
|
|
|
|
2014-08-15 17:02:21 -05:00
|
|
|
struct cg_root_opt {
|
|
|
|
struct list_head node;
|
|
|
|
char *controller;
|
|
|
|
char *newroot;
|
|
|
|
};
|
|
|
|
|
2015-06-11 20:04:03 +03:00
|
|
|
/*
|
|
|
|
* Cgroup management options.
|
|
|
|
*/
|
|
|
|
#define CG_MODE_IGNORE (0u << 0) /* Zero is important here */
|
|
|
|
#define CG_MODE_NONE (1u << 0)
|
|
|
|
#define CG_MODE_PROPS (1u << 1)
|
|
|
|
#define CG_MODE_SOFT (1u << 2)
|
|
|
|
#define CG_MODE_FULL (1u << 3)
|
|
|
|
#define CG_MODE_STRICT (1u << 4)
|
|
|
|
|
2015-07-22 18:14:00 +03:00
|
|
|
#define CG_MODE_DEFAULT (CG_MODE_SOFT)
|
2015-06-11 20:04:03 +03:00
|
|
|
|
2015-08-10 12:44:03 +03:00
|
|
|
/*
|
|
|
|
* Ghost file size we allow to carry by default.
|
|
|
|
*/
|
|
|
|
#define DEFAULT_GHOST_LIMIT (1 << 20)
|
|
|
|
|
2013-11-06 17:21:11 +04:00
|
|
|
struct cr_options {
|
|
|
|
int final_state;
|
|
|
|
char *show_dump_file;
|
2013-12-27 15:58:27 +04:00
|
|
|
char *show_fmt;
|
2013-11-06 17:21:11 +04:00
|
|
|
bool check_ms_kernel;
|
|
|
|
bool show_pages_content;
|
2015-04-03 18:03:47 +03:00
|
|
|
union {
|
|
|
|
bool restore_detach;
|
|
|
|
bool daemon_mode;
|
|
|
|
};
|
2014-09-10 15:46:06 +04:00
|
|
|
bool restore_sibling;
|
2013-11-06 17:21:11 +04:00
|
|
|
bool ext_unix_sk;
|
2015-07-29 14:05:50 +03:00
|
|
|
struct list_head ext_unixsk_ids;
|
2013-11-06 17:21:11 +04:00
|
|
|
bool shell_job;
|
|
|
|
bool handle_file_locks;
|
|
|
|
bool tcp_established_ok;
|
|
|
|
bool evasive_devices;
|
|
|
|
bool link_remap_ok;
|
|
|
|
unsigned int rst_namespaces_flags;
|
|
|
|
bool log_file_per_pid;
|
2014-06-30 20:30:44 +04:00
|
|
|
bool swrk_restore;
|
2013-11-06 17:21:11 +04:00
|
|
|
char *output;
|
|
|
|
char *root;
|
|
|
|
char *pidfile;
|
2015-08-10 14:28:17 +03:00
|
|
|
char *freeze_cgroup;
|
2013-11-06 17:21:11 +04:00
|
|
|
struct list_head veth_pairs;
|
|
|
|
struct list_head scripts;
|
2014-06-09 17:26:17 +04:00
|
|
|
struct list_head ext_mounts;
|
Add inherit fd support
There are cases where a process's file descriptor cannot be restored
from the checkpoint images. For example, a pipe file descriptor with
one end in the checkpointed process and the other end in a separate
process (that was not part of the checkpointed process tree) cannot be
restored because after checkpoint the pipe will be broken.
There are also cases where the user wants to use a new file during
restore instead of the original file at checkpoint time. For example,
the user wants to change the log file of a process from /path/to/oldlog
to /path/to/newlog.
In these cases, criu's caller should set up a new file descriptor to be
inherited by the restored process and specify the file descriptor with the
--inherit-fd command line option. The argument of --inherit-fd has the
format fd[%d]:%s, where %d tells criu which of its own file descriptors
to use for restoring the file identified by %s.
As a debugging aid, if the argument has the format debug[%d]:%s, it tells
criu to write out the string after colon to the file descriptor %d. This
can be used, for example, as an easy way to leave a "restore marker"
in the output stream of the process.
It's important to note that inherit fd support breaks applications
that depend on the state of the file descriptor being inherited. So,
consider inherit fd only for specific use cases that you know for sure
won't break the application.
For examples please visit http://criu.org/Category:HOWTO.
v2: Added a check in send_fd_to_self() to avoid closing an inherit fd.
Also, as an extra measure of caution, added checks in the inherit fd
look up functions to make sure that the inherit fd hasn't been reused.
The patch also includes minor cosmetic changes.
Signed-off-by: Saied Kazemi <saied@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-09 23:20:00 +03:00
|
|
|
struct list_head inherit_fds;
|
2013-12-19 21:35:00 +04:00
|
|
|
char *libdir;
|
2013-11-06 17:21:11 +04:00
|
|
|
bool use_page_server;
|
|
|
|
unsigned short ps_port;
|
|
|
|
char *addr;
|
2014-09-02 00:45:00 +04:00
|
|
|
int ps_socket;
|
2013-11-06 17:21:11 +04:00
|
|
|
bool track_mem;
|
|
|
|
char *img_parent;
|
2013-12-17 19:27:11 +04:00
|
|
|
bool auto_dedup;
|
2014-01-31 13:05:44 +04:00
|
|
|
unsigned int cpu_cap;
|
2014-03-06 14:56:03 +04:00
|
|
|
bool force_irmap;
|
2014-03-22 20:14:00 +04:00
|
|
|
char **exec_cmd;
|
2015-06-11 20:04:03 +03:00
|
|
|
unsigned int manage_cgroups;
|
2014-08-15 17:02:21 -05:00
|
|
|
char *new_global_cg_root;
|
|
|
|
struct list_head new_cgroup_roots;
|
2015-04-10 14:34:37 +00:00
|
|
|
bool autodetect_ext_mounts;
|
2015-04-09 10:32:33 -06:00
|
|
|
bool enable_external_sharing;
|
2015-04-09 10:32:34 -06:00
|
|
|
bool enable_external_masters;
|
2014-08-19 22:31:07 -07:00
|
|
|
bool aufs; /* auto-deteced, not via cli */
|
2015-07-24 21:15:28 +00:00
|
|
|
bool overlayfs;
|
2015-08-10 12:44:03 +03:00
|
|
|
size_t ghost_limit;
|
2013-11-06 17:21:11 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct cr_options opts;
|
|
|
|
|
|
|
|
extern void init_opts(void);
|
|
|
|
|
2013-11-15 14:04:45 +04:00
|
|
|
#endif /* __CR_OPTIONS_H__ */
|