LXC
lxccontainer.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 
3 #ifndef __LXC_CONTAINER_H
4 #define __LXC_CONTAINER_H
5 
6 #include <malloc.h>
7 #include <semaphore.h>
8 #include <stdbool.h>
9 #include <stdint.h>
10 #include <stdlib.h>
11 
12 #include <lxc/attach_options.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #define LXC_CLONE_KEEPNAME (1 << 0)
19 #define LXC_CLONE_KEEPMACADDR (1 << 1)
20 #define LXC_CLONE_SNAPSHOT (1 << 2)
21 #define LXC_CLONE_KEEPBDEVTYPE (1 << 3)
22 #define LXC_CLONE_MAYBE_SNAPSHOT (1 << 4)
23 #define LXC_CLONE_MAXFLAGS (1 << 5)
24 #define LXC_CLONE_ALLOW_RUNNING (1 << 6)
25 #define LXC_CREATE_QUIET (1 << 0)
26 #define LXC_CREATE_MAXFLAGS (1 << 1)
27 #define LXC_MOUNT_API_V1 1
28 
29 struct bdev_specs;
30 
31 struct lxc_snapshot;
32 
33 struct lxc_lock;
34 
35 struct migrate_opts;
36 
37 struct lxc_console_log;
38 
39 struct lxc_mount {
40  int version;
41 };
42 
44  uint64_t read;
45  uint64_t write;
46  uint64_t total;
47 };
48 
50  /* State of container */
51  const char *state;
52  /* The process ID of the init container */
53  pid_t init;
54  /* Current pids */
55  uint64_t pids_current;
56  /* CPU usage */
57  uint64_t cpu_use_nanos;
58  uint64_t cpu_use_user;
59  uint64_t cpu_use_sys;
60  /* BlkIO usage */
61  struct lxc_blkio_metrics io_service_bytes;
62  struct lxc_blkio_metrics io_serviced;
63  /* Memory usage */
64  uint64_t mem_used;
65  uint64_t mem_limit;
66  /* Kernel Memory usage */
67  uint64_t kmem_used;
68  uint64_t kmem_limit;
69  /* Cache usage */
70  uint64_t cache;
71  uint64_t cache_total;
72  /* total inactive file */
73  uint64_t inactive_file_total;
74 };
75 
83 struct lxc_container {
84  /* private fields */
89  char *name;
90 
95  char *configfile;
96 
101  char *pidfile;
102 
107  struct lxc_lock *slock;
108 
113  struct lxc_lock *privlock;
114 
120  int numthreads;
121 
128  struct lxc_conf *lxc_conf;
129 
130  /* public fields */
133 
136 
138  bool daemonize;
139 
141  char *config_path;
142 
147  char *exit_fifo;
150 
153 
159  char *ocihookfile;
160 
165  unsigned int start_timeout;
166 
174  bool (*is_defined)(struct lxc_container *c);
175 
185  const char *(*state)(struct lxc_container *c);
186 
194  bool (*is_running)(struct lxc_container *c);
195 
203  bool (*freeze)(struct lxc_container *c);
204 
212  bool (*unfreeze)(struct lxc_container *c);
213 
222  pid_t (*init_pid)(struct lxc_container *c);
223 
233  bool (*load_config)(struct lxc_container *c, const char *alt_file);
234 
244  bool (*start)(struct lxc_container *c, int useinit, char * const argv[]);
245 
259  bool (*startl)(struct lxc_container *c, int useinit, ...);
260 
268  bool (*stop)(struct lxc_container *c);
269 
279  bool (*want_daemonize)(struct lxc_container *c, bool state);
280 
290  bool (*want_close_all_fds)(struct lxc_container *c, bool state);
291 
301  char *(*config_file_name)(struct lxc_container *c);
302 
315  bool (*wait)(struct lxc_container *c, const char *state, int timeout);
316 
326  bool (*set_config_item)(struct lxc_container *c, const char *key, const char *value);
327 
337  bool (*destroy)(struct lxc_container *c);
338 
347  bool (*save_config)(struct lxc_container *c, const char *alt_file);
348 
366  bool (*create)(struct lxc_container *c, const char *t, const char *bdevtype,
367  struct bdev_specs *specs, int flags, char *const argv[]);
368 
389  bool (*createl)(struct lxc_container *c, const char *t, const char *bdevtype,
390  struct bdev_specs *specs, int flags, ...);
391 
400  bool (*rename)(struct lxc_container *c, const char *newname);
401 
409  bool (*reboot)(struct lxc_container *c);
410 
421  bool (*shutdown)(struct lxc_container *c, int timeout);
422 
428  void (*clear_config)(struct lxc_container *c);
429 
440  bool (*clear_config_item)(struct lxc_container *c, const char *key);
441 
460  int (*get_config_item)(struct lxc_container *c, const char *key, char *retv, int inlen);
461 
462 
473  char* (*get_running_config_item)(struct lxc_container *c, const char *key);
474 
496  int (*get_keys)(struct lxc_container *c, const char *key, char *retv, int inlen);
497 
508  char** (*get_interfaces)(struct lxc_container *c);
509 
524  char** (*get_ips)(struct lxc_container *c, const char* interface, const char* family, int scope);
525 
541  int (*get_cgroup_item)(struct lxc_container *c, const char *subsys, char *retv, int inlen);
542 
552  bool (*set_cgroup_item)(struct lxc_container *c, const char *subsys, const char *value);
553 
570  const char *(*get_config_path)(struct lxc_container *c);
571 
581  bool (*set_config_path)(struct lxc_container *c, const char *path);
582 
613  struct lxc_container *(*clone)(struct lxc_container *c, const char *newname,
614  const char *lxcpath, int flags, const char *bdevtype,
615  const char *bdevdata, uint64_t newsize, char **hookargs);
616 
635  int (*console_getfd)(struct lxc_container *c, int *ttynum, int *masterfd);
636 
654  int (*console)(struct lxc_container *c, int ttynum,
655  int stdinfd, int stdoutfd, int stderrfd, int escape);
656 
670  int (*attach)(struct lxc_container *c, lxc_attach_exec_t exec_function,
671  void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process);
672 
684  int (*attach_run_wait)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char * const argv[]);
685 
697  int (*attach_run_waitl)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *arg, ...);
698 
715  int (*snapshot)(struct lxc_container *c, const char *commentfile);
716 
729  int (*snapshot_list)(struct lxc_container *c, struct lxc_snapshot **snapshots);
730 
748  bool (*snapshot_restore)(struct lxc_container *c, const char *snapname, const char *newname);
749 
758  bool (*snapshot_destroy)(struct lxc_container *c, const char *snapname);
759 
769  bool (*may_control)(struct lxc_container *c);
770 
781  bool (*add_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path);
782 
793  bool (*remove_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path);
794 
795  /* Post LXC-1.0 additions */
796 
805  bool (*attach_interface)(struct lxc_container *c, const char *dev, const char *dst_dev);
806 
815  bool (*detach_interface)(struct lxc_container *c, const char *dev, const char *dst_dev);
827  bool (*checkpoint)(struct lxc_container *c, char *directory, bool stop, bool verbose);
828 
839  bool (*restore)(struct lxc_container *c, char *directory, bool verbose);
840 
851 
860 
861  /* Post LXC-1.1 additions */
871  int (*migrate)(struct lxc_container *c, unsigned int cmd, struct migrate_opts *opts, unsigned int size);
872 
881  int (*console_log)(struct lxc_container *c, struct lxc_console_log *log);
882 
892  bool (*reboot2)(struct lxc_container *c, int timeout);
893 
897  int (*mount)(struct lxc_container *c, const char *source,
898  const char *target, const char *filesystemtype,
899  unsigned long mountflags, const void *data,
900  struct lxc_mount *mnt);
901 
905  int (*umount)(struct lxc_container *c, const char *target,
906  unsigned long mountflags, struct lxc_mount *mnt);
907 
915  int (*seccomp_notify_fd)(struct lxc_container *c);
916 
924  int (*init_pidfd)(struct lxc_container *c);
925 
934  bool (*set_container_info_file) (struct lxc_container *c, const char *info_file);
935 
944  bool (*set_terminal_init_fifos)(struct lxc_container *c, const char *in, const char *out, const char *err);
945 
954  bool (*add_terminal_fifos)(struct lxc_container *c, const char *in, const char *out, const char *err);
955 
956  bool (*set_terminal_winch)(struct lxc_container *c, unsigned int height, unsigned int width);
957 
958  bool (*set_exec_terminal_winch)(struct lxc_container *c, const char *suffix, unsigned int height, unsigned int width);
959 
969  bool (*want_disable_pty)(struct lxc_container *c, bool state);
970 
980  bool (*want_open_stdin)(struct lxc_container *c, bool state);
981 
990  bool (*clean_container_resource) (struct lxc_container *c, pid_t pid);
991 
1001  bool (*get_container_pids)(struct lxc_container *c,pid_t **pids,size_t *pids_len);
1002 
1011  bool (*set_start_timeout)(struct lxc_container *c, unsigned int start_timeout);
1012 
1021  bool (*get_container_metrics)(struct lxc_container *c, struct lxc_container_metrics *metrics);
1022 
1023 };
1024 
1029  char *name;
1031  char *timestamp;
1032  char *lxcpath;
1038  void (*free)(struct lxc_snapshot *s);
1039 };
1040 
1041 
1045 struct bdev_specs {
1046  char *fstype;
1047  uint64_t fssize;
1048  struct {
1049  char *zfsroot;
1050  } zfs;
1051  struct {
1052  char *vg;
1053  char *lv;
1054  char *thinpool;
1055  } lvm;
1056  char *dir;
1057  struct {
1058  char *rbdname;
1059  char *rbdpool;
1060  } rbd;
1061 };
1062 
1066 enum {
1067  MIGRATE_PRE_DUMP,
1068  MIGRATE_DUMP,
1069  MIGRATE_RESTORE,
1070  MIGRATE_FEATURE_CHECK,
1071 };
1072 
1076 #define FEATURE_MEM_TRACK (1ULL << 0)
1077 #define FEATURE_LAZY_PAGES (1ULL << 1)
1078 
1083  /* new members should be added at the end */
1084  char *directory;
1085  bool verbose;
1086 
1087  bool stop; /* stop the container after dump? */
1088  char *predump_dir; /* relative to directory above */
1089  char *pageserver_address; /* where should memory pages be send? */
1090  char *pageserver_port;
1091 
1092  /* This flag indicates whether or not the container's rootfs will have
1093  * the same inodes on checkpoint and restore. In the case of e.g. zfs
1094  * send or btrfs send, or an LVM snapshot, this will be true, but it
1095  * won't if e.g. you rsync the filesystems between two machines.
1096  */
1097  bool preserves_inodes;
1098 
1099  /* Path to an executable script that will be registered as a criu
1100  * "action script"
1101  */
1102  char *action_script;
1103 
1104  /* If CRIU >= 2.4 is detected the option to skip in-flight connections
1105  * will be enabled by default. The flag 'disable_skip_in_flight' will
1106  * unconditionally disable this feature. In-flight connections are
1107  * not fully established TCP connections: SYN, SYN-ACK */
1108  bool disable_skip_in_flight;
1109 
1110  /* This is the maximum file size for deleted files (which CRIU calls
1111  * "ghost" files) that will be handled. 0 indicates the CRIU default,
1112  * which at this time is 1MB.
1113  */
1114  uint64_t ghost_limit;
1115 
1116  /* Some features cannot be checked by comparing the CRIU version.
1117  * Features like dirty page tracking or userfaultfd depend on
1118  * the architecture/kernel/criu combination. This is a bitmask
1119  * in which the desired feature checks can be encoded.
1120  */
1121  uint64_t features_to_check;
1122 };
1123 
1125  /* Clear the console log. */
1126  bool clear;
1127 
1128  /* Retrieve the console log. */
1129  bool read;
1130 
1131  /* This specifies the maximum size to read from the ringbuffer. Setting
1132  * it to 0 means that the a read can be as big as the whole ringbuffer.
1133  * On return callers can check how many bytes were actually read.
1134  * If "read" and "clear" are set to false and a non-zero value is
1135  * specified then up to "read_max" bytes of data will be discarded from
1136  * the ringbuffer.
1137  */
1138  uint64_t *read_max;
1139 
1140  /* Data that was read from the ringbuffer. If "read_max" is 0 on return
1141  * "data" is invalid.
1142  */
1143  char *data;
1144 };
1145 
1154 struct lxc_container *lxc_container_new(const char *name, const char *configpath);
1155 
1166 struct lxc_container *lxc_container_without_config_new(const char *name, const char *configpath);
1167 
1175 int lxc_container_get(struct lxc_container *c);
1176 
1187 int lxc_container_put(struct lxc_container *c);
1188 
1201 int lxc_get_wait_states(const char **states);
1202 
1210 const char *lxc_get_global_config_item(const char *key);
1211 
1218 const char *lxc_get_version(void);
1219 
1231 int list_defined_containers(const char *lxcpath, char ***names, struct lxc_container ***cret);
1232 
1247 int list_active_containers(const char *lxcpath, char ***names, struct lxc_container ***cret);
1248 
1263 int list_all_containers(const char *lxcpath, char ***names, struct lxc_container ***cret);
1264 
1265 struct lxc_log {
1266  const char *name;
1267  const char *lxcpath;
1268  const char *file;
1269  const char *level;
1270  const char *prefix;
1271  bool quiet;
1272 };
1273 
1279 int lxc_log_init(struct lxc_log *log);
1280 
1284 void lxc_log_close(void);
1285 
1291 bool lxc_config_item_is_supported(const char *key);
1292 
1298 bool lxc_has_api_extension(const char *extension);
1299 
1300 #ifdef __cplusplus
1301 }
1302 #endif
1303 
1304 #endif
lxc_container::snapshot_destroy_all
bool(* snapshot_destroy_all)(struct lxc_container *c)
Destroy all the container's snapshot.
Definition: lxccontainer.h:859
lxc_container::get_keys
int(* get_keys)(struct lxc_container *c, const char *key, char *retv, int inlen)
Retrieve a list of config item keys given a key prefix.
Definition: lxccontainer.h:496
lxc_container::is_defined
bool(* is_defined)(struct lxc_container *c)
Determine if /var/lib/lxc/$name/config exists.
Definition: lxccontainer.h:174
lxc_container::wait
bool(* wait)(struct lxc_container *c, const char *state, int timeout)
Wait for container to reach a particular state.
Definition: lxccontainer.h:315
lxc_snapshot
An LXC container snapshot.
Definition: lxccontainer.h:1028
lxc_container
Definition: lxccontainer.h:83
lxc_container::clear_config
void(* clear_config)(struct lxc_container *c)
Completely clear the containers in-memory configuration.
Definition: lxccontainer.h:428
lxc_container::may_control
bool(* may_control)(struct lxc_container *c)
Determine if the caller may control the container.
Definition: lxccontainer.h:769
lxc_container::snapshot
int(* snapshot)(struct lxc_container *c, const char *commentfile)
Create a container snapshot.
Definition: lxccontainer.h:715
lxc_container::createl
bool(* createl)(struct lxc_container *c, const char *t, const char *bdevtype, struct bdev_specs *specs, int flags,...)
Create a container (list variant).
Definition: lxccontainer.h:389
lxc_container::snapshot_list
int(* snapshot_list)(struct lxc_container *c, struct lxc_snapshot **snapshots)
Obtain a list of container snapshots.
Definition: lxccontainer.h:729
lxc_snapshot::free
void(* free)(struct lxc_snapshot *s)
De-allocate the snapshot.
Definition: lxccontainer.h:1038
lxc_container::mount
int(* mount)(struct lxc_container *c, const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data, struct lxc_mount *mnt)
Mount the host's path source onto the container's path target.
Definition: lxccontainer.h:897
lxc_snapshot::lxcpath
char * lxcpath
Definition: lxccontainer.h:1032
lxc_container::destroy
bool(* destroy)(struct lxc_container *c)
Delete the container.
Definition: lxccontainer.h:337
lxc_container::want_disable_pty
bool(* want_disable_pty)(struct lxc_container *c, bool state)
Change whether the container wants to create pty or pipes from the console log.
Definition: lxccontainer.h:969
lxc_container::set_config_item
bool(* set_config_item)(struct lxc_container *c, const char *key, const char *value)
Set a key/value configuration option.
Definition: lxccontainer.h:326
lxc_container::get_cgroup_item
int(* get_cgroup_item)(struct lxc_container *c, const char *subsys, char *retv, int inlen)
Retrieve the specified cgroup subsystem value for the container.
Definition: lxccontainer.h:541
lxc_container::migrate
int(* migrate)(struct lxc_container *c, unsigned int cmd, struct migrate_opts *opts, unsigned int size)
An API call to perform various migration operations.
Definition: lxccontainer.h:871
lxc_console_log
Definition: lxccontainer.h:1124
bdev_specs::zfsroot
char * zfsroot
Definition: lxccontainer.h:1049
lxc_snapshot::name
char * name
Definition: lxccontainer.h:1029
lxc_container::attach_run_waitl
int(* attach_run_waitl)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *arg,...)
Run a program inside a container and wait for it to exit (list variant).
Definition: lxccontainer.h:697
bdev_specs::thinpool
char * thinpool
Definition: lxccontainer.h:1054
lxc_container::create
bool(* create)(struct lxc_container *c, const char *t, const char *bdevtype, struct bdev_specs *specs, int flags, char *const argv[])
Create a container.
Definition: lxccontainer.h:366
lxc_container::get_config_item
int(* get_config_item)(struct lxc_container *c, const char *key, char *retv, int inlen)
Retrieve the value of a config item.
Definition: lxccontainer.h:460
lxc_mount
Definition: lxccontainer.h:39
lxc_container::reboot2
bool(* reboot2)(struct lxc_container *c, int timeout)
Request the container reboot by sending it SIGINT.
Definition: lxccontainer.h:892
lxc_container::start
bool(* start)(struct lxc_container *c, int useinit, char *const argv[])
Start the container.
Definition: lxccontainer.h:244
lxc_container::attach_run_wait
int(* attach_run_wait)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *const argv[])
Run a program inside a container and wait for it to exit.
Definition: lxccontainer.h:684
bdev_specs::rbdname
char * rbdname
Definition: lxccontainer.h:1058
lxc_blkio_metrics
Definition: lxccontainer.h:43
lxc_lock
Definition: lxclock.h:33
lxc_container::set_container_info_file
bool(* set_container_info_file)(struct lxc_container *c, const char *info_file)
An API call to set the path of info file.
Definition: lxccontainer.h:934
lxc_container::add_device_node
bool(* add_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path)
Add specified device to the container.
Definition: lxccontainer.h:781
bdev_specs::fstype
char * fstype
Definition: lxccontainer.h:1046
lxc_container::snapshot_restore
bool(* snapshot_restore)(struct lxc_container *c, const char *snapname, const char *newname)
Create a new container based on a snapshot.
Definition: lxccontainer.h:748
lxc_container::open_stdin
bool open_stdin
Definition: lxccontainer.h:152
bdev_specs
Specifications for how to create a new backing store.
Definition: lxccontainer.h:1045
lxc_container::attach_interface
bool(* attach_interface)(struct lxc_container *c, const char *dev, const char *dst_dev)
Add specified netdev to the container.
Definition: lxccontainer.h:805
bdev_specs::dir
char * dir
Definition: lxccontainer.h:1056
lxc_container::is_running
bool(* is_running)(struct lxc_container *c)
Determine if container is running.
Definition: lxccontainer.h:194
lxc_container::disable_pty
bool disable_pty
Definition: lxccontainer.h:149
lxc_container::checkpoint
bool(* checkpoint)(struct lxc_container *c, char *directory, bool stop, bool verbose)
Checkpoint a container.
Definition: lxccontainer.h:827
lxc_container::destroy_with_snapshots
bool(* destroy_with_snapshots)(struct lxc_container *c)
Delete the container and all its snapshots.
Definition: lxccontainer.h:850
lxc_container::add_terminal_fifos
bool(* add_terminal_fifos)(struct lxc_container *c, const char *in, const char *out, const char *err)
An API call to add the path of terminal fifos.
Definition: lxccontainer.h:954
lxc_container::save_config
bool(* save_config)(struct lxc_container *c, const char *alt_file)
Save configuration to a file.
Definition: lxccontainer.h:347
lxc_container::set_terminal_init_fifos
bool(* set_terminal_init_fifos)(struct lxc_container *c, const char *in, const char *out, const char *err)
An API call to change the path of the console default fifos.
Definition: lxccontainer.h:944
lxc_snapshot::comment_pathname
char * comment_pathname
Definition: lxccontainer.h:1030
lxc_container::shutdown
bool(* shutdown)(struct lxc_container *c, int timeout)
Request the container shutdown by sending it SIGPWR.
Definition: lxccontainer.h:421
lxc_container::rename
bool(* rename)(struct lxc_container *c, const char *newname)
Rename a container.
Definition: lxccontainer.h:400
bdev_specs::lv
char * lv
Definition: lxccontainer.h:1053
lxc_container::console_getfd
int(* console_getfd)(struct lxc_container *c, int *ttynum, int *masterfd)
Allocate a console tty for the container.
Definition: lxccontainer.h:635
lxc_container::want_daemonize
bool(* want_daemonize)(struct lxc_container *c, bool state)
Change whether the container wants to run disconnected from the terminal.
Definition: lxccontainer.h:279
lxc_container::set_start_timeout
bool(* set_start_timeout)(struct lxc_container *c, unsigned int start_timeout)
An API call to set start timeout.
Definition: lxccontainer.h:1011
lxc_attach_options_t
Definition: attach_options.h:61
lxc_container::load_config
bool(* load_config)(struct lxc_container *c, const char *alt_file)
Load the specified configuration for the container.
Definition: lxccontainer.h:233
lxc_container::remove_device_node
bool(* remove_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path)
Remove specified device from the container.
Definition: lxccontainer.h:793
lxc_container::clear_config_item
bool(* clear_config_item)(struct lxc_container *c, const char *key)
Clear a configuration item.
Definition: lxccontainer.h:440
bdev_specs::vg
char * vg
Definition: lxccontainer.h:1052
lxc_container::unfreeze
bool(* unfreeze)(struct lxc_container *c)
Thaw a frozen container.
Definition: lxccontainer.h:212
lxc_container::stop
bool(* stop)(struct lxc_container *c)
Stop the container.
Definition: lxccontainer.h:268
lxc_container::detach_interface
bool(* detach_interface)(struct lxc_container *c, const char *dev, const char *dst_dev)
Remove specified netdev from the container.
Definition: lxccontainer.h:815
lxc_container::error_string
char * error_string
Definition: lxccontainer.h:132
lxc_container::init_pid
pid_t(* init_pid)(struct lxc_container *c)
Determine process ID of the containers init process.
Definition: lxccontainer.h:222
bdev_specs::fssize
uint64_t fssize
Definition: lxccontainer.h:1047
lxc_container::error_num
int error_num
Definition: lxccontainer.h:135
lxc_container::set_cgroup_item
bool(* set_cgroup_item)(struct lxc_container *c, const char *subsys, const char *value)
Set the specified cgroup subsystem value for the container.
Definition: lxccontainer.h:552
lxc_container::restore
bool(* restore)(struct lxc_container *c, char *directory, bool verbose)
Restore a container from a checkpoint.
Definition: lxccontainer.h:839
lxc_container::get_container_pids
bool(* get_container_pids)(struct lxc_container *c, pid_t **pids, size_t *pids_len)
An API call to get container pids.
Definition: lxccontainer.h:1001
lxc_container::reboot
bool(* reboot)(struct lxc_container *c)
Request the container reboot by sending it SIGINT.
Definition: lxccontainer.h:409
lxc_container_metrics
Definition: lxccontainer.h:49
lxc_container::umount
int(* umount)(struct lxc_container *c, const char *target, unsigned long mountflags, struct lxc_mount *mnt)
Unmount the container's path target.
Definition: lxccontainer.h:905
lxc_container::state
const char *(* state)(struct lxc_container *c)
Determine state of container.
Definition: lxccontainer.h:185
bdev_specs::rbdpool
char * rbdpool
Definition: lxccontainer.h:1059
lxc_container::init_pidfd
int(* init_pidfd)(struct lxc_container *c)
Retrieve a pidfd for the container's init process.
Definition: lxccontainer.h:924
migrate_opts
Options for the migrate API call.
Definition: lxccontainer.h:1082
lxc_container::seccomp_notify_fd
int(* seccomp_notify_fd)(struct lxc_container *c)
Retrieve a file descriptor for the container's seccomp filter.
Definition: lxccontainer.h:915
lxc_container::config_path
char * config_path
Definition: lxccontainer.h:141
lxc_container::freeze
bool(* freeze)(struct lxc_container *c)
Freeze running container.
Definition: lxccontainer.h:203
lxc_container::daemonize
bool daemonize
Definition: lxccontainer.h:138
lxc_container::want_close_all_fds
bool(* want_close_all_fds)(struct lxc_container *c, bool state)
Change whether the container wishes all file descriptors to be closed on startup.
Definition: lxccontainer.h:290
lxc_container::snapshot_destroy
bool(* snapshot_destroy)(struct lxc_container *c, const char *snapname)
Destroy the specified snapshot.
Definition: lxccontainer.h:758
lxc_log
Definition: lxccontainer.h:1265
lxc_container::console
int(* console)(struct lxc_container *c, int ttynum, int stdinfd, int stdoutfd, int stderrfd, int escape)
Allocate and run a console tty.
Definition: lxccontainer.h:654
lxc_container::console_log
int(* console_log)(struct lxc_container *c, struct lxc_console_log *log)
Query the console log of a container.
Definition: lxccontainer.h:881
lxc_container::get_container_metrics
bool(* get_container_metrics)(struct lxc_container *c, struct lxc_container_metrics *metrics)
An API call to set start timeout.
Definition: lxccontainer.h:1021
lxc_container::set_config_path
bool(* set_config_path)(struct lxc_container *c, const char *path)
Set the full path to the containers configuration file.
Definition: lxccontainer.h:581
lxc_container::startl
bool(* startl)(struct lxc_container *c, int useinit,...)
Start the container (list variant).
Definition: lxccontainer.h:259
lxc_container::want_open_stdin
bool(* want_open_stdin)(struct lxc_container *c, bool state)
Change whether the container wants to keep stdin active for parent process of container.
Definition: lxccontainer.h:980
lxc_container::attach
int(* attach)(struct lxc_container *c, lxc_attach_exec_t exec_function, void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process)
Create a sub-process attached to a container and run a function inside it.
Definition: lxccontainer.h:670
lxc_container::clean_container_resource
bool(* clean_container_resource)(struct lxc_container *c, pid_t pid)
An API call to clean resources of container.
Definition: lxccontainer.h:990
lxc_snapshot::timestamp
char * timestamp
Definition: lxccontainer.h:1031