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 };
73 
81 struct lxc_container {
82  /* private fields */
87  char *name;
88 
93  char *configfile;
94 
99  char *pidfile;
100 
105  struct lxc_lock *slock;
106 
111  struct lxc_lock *privlock;
112 
118  int numthreads;
119 
126  struct lxc_conf *lxc_conf;
127 
128  /* public fields */
131 
134 
136  bool daemonize;
137 
139  char *config_path;
140 
145  char *exit_fifo;
148 
151 
157  char *ocihookfile;
158 
163  unsigned int start_timeout;
164 
172  bool (*is_defined)(struct lxc_container *c);
173 
183  const char *(*state)(struct lxc_container *c);
184 
192  bool (*is_running)(struct lxc_container *c);
193 
201  bool (*freeze)(struct lxc_container *c);
202 
210  bool (*unfreeze)(struct lxc_container *c);
211 
220  pid_t (*init_pid)(struct lxc_container *c);
221 
231  bool (*load_config)(struct lxc_container *c, const char *alt_file);
232 
242  bool (*start)(struct lxc_container *c, int useinit, char * const argv[]);
243 
257  bool (*startl)(struct lxc_container *c, int useinit, ...);
258 
266  bool (*stop)(struct lxc_container *c);
267 
277  bool (*want_daemonize)(struct lxc_container *c, bool state);
278 
288  bool (*want_close_all_fds)(struct lxc_container *c, bool state);
289 
299  char *(*config_file_name)(struct lxc_container *c);
300 
313  bool (*wait)(struct lxc_container *c, const char *state, int timeout);
314 
324  bool (*set_config_item)(struct lxc_container *c, const char *key, const char *value);
325 
335  bool (*destroy)(struct lxc_container *c);
336 
345  bool (*save_config)(struct lxc_container *c, const char *alt_file);
346 
364  bool (*create)(struct lxc_container *c, const char *t, const char *bdevtype,
365  struct bdev_specs *specs, int flags, char *const argv[]);
366 
387  bool (*createl)(struct lxc_container *c, const char *t, const char *bdevtype,
388  struct bdev_specs *specs, int flags, ...);
389 
398  bool (*rename)(struct lxc_container *c, const char *newname);
399 
407  bool (*reboot)(struct lxc_container *c);
408 
419  bool (*shutdown)(struct lxc_container *c, int timeout);
420 
426  void (*clear_config)(struct lxc_container *c);
427 
438  bool (*clear_config_item)(struct lxc_container *c, const char *key);
439 
458  int (*get_config_item)(struct lxc_container *c, const char *key, char *retv, int inlen);
459 
460 
471  char* (*get_running_config_item)(struct lxc_container *c, const char *key);
472 
494  int (*get_keys)(struct lxc_container *c, const char *key, char *retv, int inlen);
495 
506  char** (*get_interfaces)(struct lxc_container *c);
507 
522  char** (*get_ips)(struct lxc_container *c, const char* interface, const char* family, int scope);
523 
539  int (*get_cgroup_item)(struct lxc_container *c, const char *subsys, char *retv, int inlen);
540 
550  bool (*set_cgroup_item)(struct lxc_container *c, const char *subsys, const char *value);
551 
568  const char *(*get_config_path)(struct lxc_container *c);
569 
579  bool (*set_config_path)(struct lxc_container *c, const char *path);
580 
611  struct lxc_container *(*clone)(struct lxc_container *c, const char *newname,
612  const char *lxcpath, int flags, const char *bdevtype,
613  const char *bdevdata, uint64_t newsize, char **hookargs);
614 
633  int (*console_getfd)(struct lxc_container *c, int *ttynum, int *masterfd);
634 
652  int (*console)(struct lxc_container *c, int ttynum,
653  int stdinfd, int stdoutfd, int stderrfd, int escape);
654 
668  int (*attach)(struct lxc_container *c, lxc_attach_exec_t exec_function,
669  void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process);
670 
682  int (*attach_run_wait)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char * const argv[]);
683 
695  int (*attach_run_waitl)(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *arg, ...);
696 
713  int (*snapshot)(struct lxc_container *c, const char *commentfile);
714 
727  int (*snapshot_list)(struct lxc_container *c, struct lxc_snapshot **snapshots);
728 
746  bool (*snapshot_restore)(struct lxc_container *c, const char *snapname, const char *newname);
747 
756  bool (*snapshot_destroy)(struct lxc_container *c, const char *snapname);
757 
767  bool (*may_control)(struct lxc_container *c);
768 
779  bool (*add_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path);
780 
791  bool (*remove_device_node)(struct lxc_container *c, const char *src_path, const char *dest_path);
792 
793  /* Post LXC-1.0 additions */
794 
803  bool (*attach_interface)(struct lxc_container *c, const char *dev, const char *dst_dev);
804 
813  bool (*detach_interface)(struct lxc_container *c, const char *dev, const char *dst_dev);
825  bool (*checkpoint)(struct lxc_container *c, char *directory, bool stop, bool verbose);
826 
837  bool (*restore)(struct lxc_container *c, char *directory, bool verbose);
838 
849 
858 
859  /* Post LXC-1.1 additions */
869  int (*migrate)(struct lxc_container *c, unsigned int cmd, struct migrate_opts *opts, unsigned int size);
870 
879  int (*console_log)(struct lxc_container *c, struct lxc_console_log *log);
880 
890  bool (*reboot2)(struct lxc_container *c, int timeout);
891 
895  int (*mount)(struct lxc_container *c, const char *source,
896  const char *target, const char *filesystemtype,
897  unsigned long mountflags, const void *data,
898  struct lxc_mount *mnt);
899 
903  int (*umount)(struct lxc_container *c, const char *target,
904  unsigned long mountflags, struct lxc_mount *mnt);
905 
913  int (*seccomp_notify_fd)(struct lxc_container *c);
914 
922  int (*init_pidfd)(struct lxc_container *c);
923 
932  bool (*set_container_info_file) (struct lxc_container *c, const char *info_file);
933 
942  bool (*set_terminal_init_fifos)(struct lxc_container *c, const char *in, const char *out, const char *err);
943 
952  bool (*add_terminal_fifos)(struct lxc_container *c, const char *in, const char *out, const char *err);
953 
954  bool (*set_terminal_winch)(struct lxc_container *c, unsigned int height, unsigned int width);
955 
956  bool (*set_exec_terminal_winch)(struct lxc_container *c, const char *suffix, unsigned int height, unsigned int width);
957 
967  bool (*want_disable_pty)(struct lxc_container *c, bool state);
968 
978  bool (*want_open_stdin)(struct lxc_container *c, bool state);
979 
988  bool (*clean_container_resource) (struct lxc_container *c, pid_t pid);
989 
999  bool (*get_container_pids)(struct lxc_container *c,pid_t **pids,size_t *pids_len);
1000 
1009  bool (*set_start_timeout)(struct lxc_container *c, unsigned int start_timeout);
1010 
1019  bool (*get_container_metrics)(struct lxc_container *c, struct lxc_container_metrics *metrics);
1020 
1021 };
1022 
1027  char *name;
1029  char *timestamp;
1030  char *lxcpath;
1036  void (*free)(struct lxc_snapshot *s);
1037 };
1038 
1039 
1043 struct bdev_specs {
1044  char *fstype;
1045  uint64_t fssize;
1046  struct {
1047  char *zfsroot;
1048  } zfs;
1049  struct {
1050  char *vg;
1051  char *lv;
1052  char *thinpool;
1053  } lvm;
1054  char *dir;
1055  struct {
1056  char *rbdname;
1057  char *rbdpool;
1058  } rbd;
1059 };
1060 
1064 enum {
1065  MIGRATE_PRE_DUMP,
1066  MIGRATE_DUMP,
1067  MIGRATE_RESTORE,
1068  MIGRATE_FEATURE_CHECK,
1069 };
1070 
1074 #define FEATURE_MEM_TRACK (1ULL << 0)
1075 #define FEATURE_LAZY_PAGES (1ULL << 1)
1076 
1081  /* new members should be added at the end */
1082  char *directory;
1083  bool verbose;
1084 
1085  bool stop; /* stop the container after dump? */
1086  char *predump_dir; /* relative to directory above */
1087  char *pageserver_address; /* where should memory pages be send? */
1088  char *pageserver_port;
1089 
1090  /* This flag indicates whether or not the container's rootfs will have
1091  * the same inodes on checkpoint and restore. In the case of e.g. zfs
1092  * send or btrfs send, or an LVM snapshot, this will be true, but it
1093  * won't if e.g. you rsync the filesystems between two machines.
1094  */
1095  bool preserves_inodes;
1096 
1097  /* Path to an executable script that will be registered as a criu
1098  * "action script"
1099  */
1100  char *action_script;
1101 
1102  /* If CRIU >= 2.4 is detected the option to skip in-flight connections
1103  * will be enabled by default. The flag 'disable_skip_in_flight' will
1104  * unconditionally disable this feature. In-flight connections are
1105  * not fully established TCP connections: SYN, SYN-ACK */
1106  bool disable_skip_in_flight;
1107 
1108  /* This is the maximum file size for deleted files (which CRIU calls
1109  * "ghost" files) that will be handled. 0 indicates the CRIU default,
1110  * which at this time is 1MB.
1111  */
1112  uint64_t ghost_limit;
1113 
1114  /* Some features cannot be checked by comparing the CRIU version.
1115  * Features like dirty page tracking or userfaultfd depend on
1116  * the architecture/kernel/criu combination. This is a bitmask
1117  * in which the desired feature checks can be encoded.
1118  */
1119  uint64_t features_to_check;
1120 };
1121 
1123  /* Clear the console log. */
1124  bool clear;
1125 
1126  /* Retrieve the console log. */
1127  bool read;
1128 
1129  /* This specifies the maximum size to read from the ringbuffer. Setting
1130  * it to 0 means that the a read can be as big as the whole ringbuffer.
1131  * On return callers can check how many bytes were actually read.
1132  * If "read" and "clear" are set to false and a non-zero value is
1133  * specified then up to "read_max" bytes of data will be discarded from
1134  * the ringbuffer.
1135  */
1136  uint64_t *read_max;
1137 
1138  /* Data that was read from the ringbuffer. If "read_max" is 0 on return
1139  * "data" is invalid.
1140  */
1141  char *data;
1142 };
1143 
1152 struct lxc_container *lxc_container_new(const char *name, const char *configpath);
1153 
1164 struct lxc_container *lxc_container_without_config_new(const char *name, const char *configpath);
1165 
1173 int lxc_container_get(struct lxc_container *c);
1174 
1185 int lxc_container_put(struct lxc_container *c);
1186 
1199 int lxc_get_wait_states(const char **states);
1200 
1208 const char *lxc_get_global_config_item(const char *key);
1209 
1216 const char *lxc_get_version(void);
1217 
1229 int list_defined_containers(const char *lxcpath, char ***names, struct lxc_container ***cret);
1230 
1245 int list_active_containers(const char *lxcpath, char ***names, struct lxc_container ***cret);
1246 
1261 int list_all_containers(const char *lxcpath, char ***names, struct lxc_container ***cret);
1262 
1263 struct lxc_log {
1264  const char *name;
1265  const char *lxcpath;
1266  const char *file;
1267  const char *level;
1268  const char *prefix;
1269  bool quiet;
1270 };
1271 
1277 int lxc_log_init(struct lxc_log *log);
1278 
1282 void lxc_log_close(void);
1283 
1289 bool lxc_config_item_is_supported(const char *key);
1290 
1296 bool lxc_has_api_extension(const char *extension);
1297 
1298 #ifdef __cplusplus
1299 }
1300 #endif
1301 
1302 #endif
lxc_container::snapshot_destroy_all
bool(* snapshot_destroy_all)(struct lxc_container *c)
Destroy all the container's snapshot.
Definition: lxccontainer.h:857
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:494
lxc_container::is_defined
bool(* is_defined)(struct lxc_container *c)
Determine if /var/lib/lxc/$name/config exists.
Definition: lxccontainer.h:172
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:313
lxc_snapshot
An LXC container snapshot.
Definition: lxccontainer.h:1026
lxc_container
Definition: lxccontainer.h:81
lxc_container::clear_config
void(* clear_config)(struct lxc_container *c)
Completely clear the containers in-memory configuration.
Definition: lxccontainer.h:426
lxc_container::may_control
bool(* may_control)(struct lxc_container *c)
Determine if the caller may control the container.
Definition: lxccontainer.h:767
lxc_container::snapshot
int(* snapshot)(struct lxc_container *c, const char *commentfile)
Create a container snapshot.
Definition: lxccontainer.h:713
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:387
lxc_container::snapshot_list
int(* snapshot_list)(struct lxc_container *c, struct lxc_snapshot **snapshots)
Obtain a list of container snapshots.
Definition: lxccontainer.h:727
lxc_snapshot::free
void(* free)(struct lxc_snapshot *s)
De-allocate the snapshot.
Definition: lxccontainer.h:1036
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:895
lxc_snapshot::lxcpath
char * lxcpath
Definition: lxccontainer.h:1030
lxc_container::destroy
bool(* destroy)(struct lxc_container *c)
Delete the container.
Definition: lxccontainer.h:335
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:967
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:324
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:539
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:869
lxc_console_log
Definition: lxccontainer.h:1122
bdev_specs::zfsroot
char * zfsroot
Definition: lxccontainer.h:1047
lxc_snapshot::name
char * name
Definition: lxccontainer.h:1027
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:695
bdev_specs::thinpool
char * thinpool
Definition: lxccontainer.h:1052
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:364
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:458
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:890
lxc_container::start
bool(* start)(struct lxc_container *c, int useinit, char *const argv[])
Start the container.
Definition: lxccontainer.h:242
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:682
bdev_specs::rbdname
char * rbdname
Definition: lxccontainer.h:1056
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:932
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:779
bdev_specs::fstype
char * fstype
Definition: lxccontainer.h:1044
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:746
lxc_container::open_stdin
bool open_stdin
Definition: lxccontainer.h:150
bdev_specs
Specifications for how to create a new backing store.
Definition: lxccontainer.h:1043
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:803
bdev_specs::dir
char * dir
Definition: lxccontainer.h:1054
lxc_container::is_running
bool(* is_running)(struct lxc_container *c)
Determine if container is running.
Definition: lxccontainer.h:192
lxc_container::disable_pty
bool disable_pty
Definition: lxccontainer.h:147
lxc_container::checkpoint
bool(* checkpoint)(struct lxc_container *c, char *directory, bool stop, bool verbose)
Checkpoint a container.
Definition: lxccontainer.h:825
lxc_container::destroy_with_snapshots
bool(* destroy_with_snapshots)(struct lxc_container *c)
Delete the container and all its snapshots.
Definition: lxccontainer.h:848
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:952
lxc_container::save_config
bool(* save_config)(struct lxc_container *c, const char *alt_file)
Save configuration to a file.
Definition: lxccontainer.h:345
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:942
lxc_snapshot::comment_pathname
char * comment_pathname
Definition: lxccontainer.h:1028
lxc_container::shutdown
bool(* shutdown)(struct lxc_container *c, int timeout)
Request the container shutdown by sending it SIGPWR.
Definition: lxccontainer.h:419
lxc_container::rename
bool(* rename)(struct lxc_container *c, const char *newname)
Rename a container.
Definition: lxccontainer.h:398
bdev_specs::lv
char * lv
Definition: lxccontainer.h:1051
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:633
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:277
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:1009
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:231
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:791
lxc_container::clear_config_item
bool(* clear_config_item)(struct lxc_container *c, const char *key)
Clear a configuration item.
Definition: lxccontainer.h:438
bdev_specs::vg
char * vg
Definition: lxccontainer.h:1050
lxc_container::unfreeze
bool(* unfreeze)(struct lxc_container *c)
Thaw a frozen container.
Definition: lxccontainer.h:210
lxc_container::stop
bool(* stop)(struct lxc_container *c)
Stop the container.
Definition: lxccontainer.h:266
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:813
lxc_container::error_string
char * error_string
Definition: lxccontainer.h:130
lxc_container::init_pid
pid_t(* init_pid)(struct lxc_container *c)
Determine process ID of the containers init process.
Definition: lxccontainer.h:220
bdev_specs::fssize
uint64_t fssize
Definition: lxccontainer.h:1045
lxc_container::error_num
int error_num
Definition: lxccontainer.h:133
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:550
lxc_container::restore
bool(* restore)(struct lxc_container *c, char *directory, bool verbose)
Restore a container from a checkpoint.
Definition: lxccontainer.h:837
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:999
lxc_container::reboot
bool(* reboot)(struct lxc_container *c)
Request the container reboot by sending it SIGINT.
Definition: lxccontainer.h:407
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:903
lxc_container::state
const char *(* state)(struct lxc_container *c)
Determine state of container.
Definition: lxccontainer.h:183
bdev_specs::rbdpool
char * rbdpool
Definition: lxccontainer.h:1057
lxc_container::init_pidfd
int(* init_pidfd)(struct lxc_container *c)
Retrieve a pidfd for the container's init process.
Definition: lxccontainer.h:922
migrate_opts
Options for the migrate API call.
Definition: lxccontainer.h:1080
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:913
lxc_container::config_path
char * config_path
Definition: lxccontainer.h:139
lxc_container::freeze
bool(* freeze)(struct lxc_container *c)
Freeze running container.
Definition: lxccontainer.h:201
lxc_container::daemonize
bool daemonize
Definition: lxccontainer.h:136
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:288
lxc_container::snapshot_destroy
bool(* snapshot_destroy)(struct lxc_container *c, const char *snapname)
Destroy the specified snapshot.
Definition: lxccontainer.h:756
lxc_log
Definition: lxccontainer.h:1263
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:652
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:879
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:1019
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:579
lxc_container::startl
bool(* startl)(struct lxc_container *c, int useinit,...)
Start the container (list variant).
Definition: lxccontainer.h:257
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:978
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:668
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:988
lxc_snapshot::timestamp
char * timestamp
Definition: lxccontainer.h:1029