2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00
criu/include/cr_options.h
Tycho Andersen 94f6c87c9f cg: add --cgroup-root option
The motivation for this is to be able to restore containers into cgroups other
than what they were dumped in (if, e.g. they might conflict with an existing
container). Suppose you have a container in:

memory:/mycontainer
cpuacct,cpu:/mycontainer
blkio:/mycontainer
name=systemd:/mycontainer

You could then restore them to /mycontainer2 via --cgroup-root /mycontainer2.
If you want to restore different controllers to different paths, you can
provide multiple arguments, for example, passing:

--cgroup-root /mycontainer2 --cgroup-root cpuacct,cpu:/specialcpu \
--cgroup-root name=systemd:/specialsystemd

Would result in things being restored to:

memory:/mycontainer2
cpuacct,cpu:/specialcpu
blkio:/mycontainer2
name=systemd:/specialsystemd

i.e. a --cgroup-root without a controller prefix specifies the new default root
for all cgroups.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-08-19 12:58:36 +04:00

70 lines
1.3 KiB
C

#ifndef __CR_OPTIONS_H__
#define __CR_OPTIONS_H__
#include <stdbool.h>
#include "list.h"
struct script {
struct list_head node;
char *path;
int arg;
};
#define SCRIPT_RPC_NOTIFY (char *)0x1
/*
* CPU capability options.
*/
#define CPU_CAP_FPU (1u)
#define CPU_CAP_ALL (-1u)
struct cg_root_opt {
struct list_head node;
char *controller;
char *newroot;
};
struct cr_options {
int final_state;
char *show_dump_file;
char *show_fmt;
bool check_ms_kernel;
bool show_pages_content;
bool restore_detach;
bool ext_unix_sk;
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;
bool swrk_restore;
char *output;
char *root;
char *pidfile;
struct list_head veth_pairs;
struct list_head scripts;
struct list_head ext_mounts;
char *libdir;
bool use_page_server;
unsigned short ps_port;
char *addr;
bool track_mem;
char *img_parent;
bool auto_dedup;
unsigned int cpu_cap;
bool force_irmap;
char **exec_cmd;
bool manage_cgroups;
char *new_global_cg_root;
struct list_head new_cgroup_roots;
};
extern struct cr_options opts;
extern void init_opts(void);
#endif /* __CR_OPTIONS_H__ */