diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 9929ee082..d7ba2aaa0 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -127,78 +127,78 @@ static int config_limit(const char *, const char *, struct lxc_conf *); static struct lxc_config_t config[] = { - { "lxc.arch", config_personality }, - { "lxc.pts", config_pts }, - { "lxc.tty", config_tty }, - { "lxc.devttydir", config_ttydir }, - { "lxc.kmsg", config_kmsg }, - { "lxc.aa_profile", config_lsm_aa_profile }, - { "lxc.aa_allow_incomplete", config_lsm_aa_incomplete }, - { "lxc.se_context", config_lsm_se_context }, - { "lxc.cgroup", config_cgroup }, - { "lxc.id_map", config_idmap }, - { "lxc.loglevel", config_loglevel }, - { "lxc.logfile", config_logfile }, - { "lxc.mount.entry", config_mount }, - { "lxc.mount.auto", config_mount_auto }, - { "lxc.mount", config_fstab }, - { "lxc.rootfs.mount", config_rootfs_mount }, - { "lxc.rootfs.options", config_rootfs_options }, - { "lxc.rootfs.backend", config_rootfs_backend }, - { "lxc.rootfs", config_rootfs }, - { "lxc.pivotdir", config_pivotdir }, - { "lxc.utsname", config_utsname }, - { "lxc.hook.pre-start", config_hook }, - { "lxc.hook.pre-mount", config_hook }, - { "lxc.hook.mount", config_hook }, - { "lxc.hook.autodev", config_hook }, - { "lxc.hook.start", config_hook }, - { "lxc.hook.stop", config_hook }, - { "lxc.hook.post-stop", config_hook }, - { "lxc.hook.clone", config_hook }, - { "lxc.hook.destroy", config_hook }, - { "lxc.hook", config_hook }, - { "lxc.network.type", config_network_type }, - { "lxc.network.flags", config_network_flags }, - { "lxc.network.link", config_network_link }, - { "lxc.network.name", config_network_name }, - { "lxc.network.macvlan.mode", config_network_macvlan_mode }, - { "lxc.network.veth.pair", config_network_veth_pair }, - { "lxc.network.script.up", config_network_script_up }, - { "lxc.network.script.down", config_network_script_down }, - { "lxc.network.hwaddr", config_network_hwaddr }, - { "lxc.network.mtu", config_network_mtu }, - { "lxc.network.vlan.id", config_network_vlan_id }, - { "lxc.network.ipv4.gateway", config_network_ipv4_gateway }, - { "lxc.network.ipv4", config_network_ipv4 }, - { "lxc.network.ipv6.gateway", config_network_ipv6_gateway }, - { "lxc.network.ipv6", config_network_ipv6 }, + { "lxc.arch", config_personality, NULL, NULL}, + { "lxc.pts", config_pts, NULL, NULL}, + { "lxc.tty", config_tty, NULL, NULL}, + { "lxc.devttydir", config_ttydir, NULL, NULL}, + { "lxc.kmsg", config_kmsg, NULL, NULL}, + { "lxc.aa_profile", config_lsm_aa_profile, NULL, NULL}, + { "lxc.aa_allow_incomplete", config_lsm_aa_incomplete, NULL, NULL}, + { "lxc.se_context", config_lsm_se_context, NULL, NULL}, + { "lxc.cgroup", config_cgroup, NULL, NULL}, + { "lxc.id_map", config_idmap, NULL, NULL}, + { "lxc.loglevel", config_loglevel, NULL, NULL}, + { "lxc.logfile", config_logfile, NULL, NULL}, + { "lxc.mount.entry", config_mount, NULL, NULL}, + { "lxc.mount.auto", config_mount_auto, NULL, NULL}, + { "lxc.mount", config_fstab, NULL, NULL}, + { "lxc.rootfs.mount", config_rootfs_mount, NULL, NULL}, + { "lxc.rootfs.options", config_rootfs_options, NULL, NULL}, + { "lxc.rootfs.backend", config_rootfs_backend, NULL, NULL}, + { "lxc.rootfs", config_rootfs, NULL, NULL}, + { "lxc.pivotdir", config_pivotdir, NULL, NULL}, + { "lxc.utsname", config_utsname, NULL, NULL}, + { "lxc.hook.pre-start", config_hook, NULL, NULL}, + { "lxc.hook.pre-mount", config_hook, NULL, NULL}, + { "lxc.hook.mount", config_hook, NULL, NULL}, + { "lxc.hook.autodev", config_hook, NULL, NULL}, + { "lxc.hook.start", config_hook, NULL, NULL}, + { "lxc.hook.stop", config_hook, NULL, NULL}, + { "lxc.hook.post-stop", config_hook, NULL, NULL}, + { "lxc.hook.clone", config_hook, NULL, NULL}, + { "lxc.hook.destroy", config_hook, NULL, NULL}, + { "lxc.hook", config_hook, NULL, NULL}, + { "lxc.network.type", config_network_type, NULL, NULL}, + { "lxc.network.flags", config_network_flags, NULL, NULL}, + { "lxc.network.link", config_network_link, NULL, NULL}, + { "lxc.network.name", config_network_name, NULL, NULL}, + { "lxc.network.macvlan.mode", config_network_macvlan_mode, NULL, NULL}, + { "lxc.network.veth.pair", config_network_veth_pair, NULL, NULL}, + { "lxc.network.script.up", config_network_script_up, NULL, NULL}, + { "lxc.network.script.down", config_network_script_down, NULL, NULL}, + { "lxc.network.hwaddr", config_network_hwaddr, NULL, NULL}, + { "lxc.network.mtu", config_network_mtu, NULL, NULL}, + { "lxc.network.vlan.id", config_network_vlan_id, NULL, NULL}, + { "lxc.network.ipv4.gateway", config_network_ipv4_gateway, NULL, NULL}, + { "lxc.network.ipv4", config_network_ipv4, NULL, NULL}, + { "lxc.network.ipv6.gateway", config_network_ipv6_gateway, NULL, NULL}, + { "lxc.network.ipv6", config_network_ipv6, NULL, NULL}, /* config_network_nic must come after all other 'lxc.network.*' entries */ - { "lxc.network.", config_network_nic }, - { "lxc.network", config_network }, - { "lxc.cap.drop", config_cap_drop }, - { "lxc.cap.keep", config_cap_keep }, - { "lxc.console.logfile", config_console_logfile }, - { "lxc.console", config_console }, - { "lxc.seccomp", config_seccomp }, - { "lxc.include", config_includefile }, - { "lxc.autodev", config_autodev }, - { "lxc.haltsignal", config_haltsignal }, - { "lxc.rebootsignal", config_rebootsignal }, - { "lxc.stopsignal", config_stopsignal }, - { "lxc.start.auto", config_start }, - { "lxc.start.delay", config_start }, - { "lxc.start.order", config_start }, - { "lxc.monitor.unshare", config_monitor }, - { "lxc.group", config_group }, - { "lxc.environment", config_environment }, - { "lxc.init_cmd", config_init_cmd }, - { "lxc.init_uid", config_init_uid }, - { "lxc.init_gid", config_init_gid }, - { "lxc.ephemeral", config_ephemeral }, - { "lxc.syslog", config_syslog }, - { "lxc.no_new_privs", config_no_new_privs }, - { "lxc.limit", config_limit }, + { "lxc.network.", config_network_nic, NULL, NULL}, + { "lxc.network", config_network, NULL, NULL}, + { "lxc.cap.drop", config_cap_drop, NULL, NULL}, + { "lxc.cap.keep", config_cap_keep, NULL, NULL}, + { "lxc.console.logfile", config_console_logfile, NULL, NULL}, + { "lxc.console", config_console, NULL, NULL}, + { "lxc.seccomp", config_seccomp, NULL, NULL}, + { "lxc.include", config_includefile, NULL, NULL}, + { "lxc.autodev", config_autodev, NULL, NULL}, + { "lxc.haltsignal", config_haltsignal, NULL, NULL}, + { "lxc.rebootsignal", config_rebootsignal, NULL, NULL}, + { "lxc.stopsignal", config_stopsignal, NULL, NULL}, + { "lxc.start.auto", config_start, NULL, NULL}, + { "lxc.start.delay", config_start, NULL, NULL}, + { "lxc.start.order", config_start, NULL, NULL}, + { "lxc.monitor.unshare", config_monitor, NULL, NULL}, + { "lxc.group", config_group, NULL, NULL}, + { "lxc.environment", config_environment, NULL, NULL}, + { "lxc.init_cmd", config_init_cmd, NULL, NULL}, + { "lxc.init_uid", config_init_uid, NULL, NULL}, + { "lxc.init_gid", config_init_gid, NULL, NULL}, + { "lxc.ephemeral", config_ephemeral, NULL, NULL}, + { "lxc.syslog", config_syslog, NULL, NULL}, + { "lxc.no_new_privs", config_no_new_privs, NULL, NULL}, + { "lxc.limit", config_limit, NULL, NULL}, }; struct signame { diff --git a/src/lxc/confile.h b/src/lxc/confile.h index 36e4bcb08..7dcf8f2b3 100644 --- a/src/lxc/confile.h +++ b/src/lxc/confile.h @@ -30,13 +30,16 @@ struct lxc_conf; struct lxc_list; +struct lxc_container; -typedef int (*config_cb)(const char *, const char *, struct lxc_conf *); +typedef int (*config_set_cb)(const char *, const char *, struct lxc_conf *); +typedef int (*config_get_cb)(struct lxc_container *, const char *, char *, int); +typedef int (*config_clear_cb)(void); struct lxc_config_t { char *name; - config_cb set; - config_cb get; - config_cb clear; + config_set_cb set; + config_get_cb get; + config_clear_cb clear; }; extern struct lxc_config_t *lxc_getconfig(const char *key);