From: Christian Brauner Date: Sat, 18 Jul 2020 17:07:31 +0000 (+0200) Subject: confile: hide unnecessary symbols X-Git-Tag: lxc-5.0.0~384^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63c2a0bf06d5ddd7cbbc908ea1e403b69f4b6a0c;p=thirdparty%2Flxc.git confile: hide unnecessary symbols Signed-off-by: Christian Brauner --- diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index 814d96d21..4adcc679d 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -334,6 +334,7 @@ lxc_attach_SOURCES = tools/lxc_attach.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ rexec.c rexec.h \ string_utils.c string_utils.h lxc_autostart_SOURCES = tools/lxc_autostart.c \ @@ -341,60 +342,70 @@ lxc_autostart_SOURCES = tools/lxc_autostart.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_cgroup_SOURCES = tools/lxc_cgroup.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_config_SOURCES = tools/lxc_config.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_console_SOURCES = tools/lxc_console.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_destroy_SOURCES = tools/lxc_destroy.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_device_SOURCES = tools/lxc_device.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_execute_SOURCES = tools/lxc_execute.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_freeze_SOURCES = tools/lxc_freeze.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_info_SOURCES = tools/lxc_info.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_monitor_SOURCES = tools/lxc_monitor.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ macro.h \ string_utils.c string_utils.h lxc_ls_SOURCES = tools/lxc_ls.c \ @@ -402,6 +413,7 @@ lxc_ls_SOURCES = tools/lxc_ls.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ memory_utils.h \ string_utils.c string_utils.h lxc_copy_SOURCES = tools/lxc_copy.c \ @@ -409,6 +421,7 @@ lxc_copy_SOURCES = tools/lxc_copy.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ storage/storage_utils.c storage/storage_utils.h \ string_utils.c string_utils.h lxc_start_SOURCES = tools/lxc_start.c \ @@ -416,30 +429,35 @@ lxc_start_SOURCES = tools/lxc_start.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_stop_SOURCES = tools/lxc_stop.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_top_SOURCES = tools/lxc_top.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_unshare_SOURCES = tools/lxc_unshare.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h \ syscall_numbers.h \ syscall_wrappers.h @@ -448,12 +466,14 @@ lxc_wait_SOURCES = tools/lxc_wait.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_create_SOURCES = tools/lxc_create.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ storage/storage_utils.c storage/storage_utils.h \ string_utils.c string_utils.h lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ @@ -461,12 +481,14 @@ lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \ tools/arguments.c tools/arguments.h \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ string_utils.c string_utils.h endif @@ -488,6 +510,7 @@ lxc_monitord_SOURCES = cmd/lxc_monitord.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ log.c log.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ @@ -500,6 +523,7 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ log.c log.h \ memory_utils.h \ network.c network.h \ @@ -514,6 +538,7 @@ lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \ af_unix.c af_unix.h \ caps.c caps.h \ conf.c conf.h \ + confile.c confile.h \ file_utils.c file_utils.h \ list.h \ log.c log.h \ diff --git a/src/lxc/confile.h b/src/lxc/confile.h index a457c9a17..df80f639a 100644 --- a/src/lxc/confile.h +++ b/src/lxc/confile.h @@ -45,66 +45,61 @@ struct new_config_item { }; /* Get the jump table entry for the given configuration key. */ -extern struct lxc_config_t *lxc_get_config(const char *key); +__hidden extern struct lxc_config_t *lxc_get_config(const char *key); /* List all available config items. */ -extern int lxc_list_config_items(char *retv, int inlen) +__hidden extern int lxc_list_config_items(char *retv, int inlen) __access_rw(1, 2); /* Given a configuration key namespace (e.g. lxc.apparmor) list all associated * subkeys for that namespace. * Must be implemented when adding a new configuration key. */ -extern int lxc_list_subkeys(struct lxc_conf *conf, const char *key, char *retv, - int inlen) -__access_rw(3, 4); +__hidden extern int lxc_list_subkeys(struct lxc_conf *conf, const char *key, char *retv, int inlen) + __access_rw(3, 4); /* List all configuration items associated with a given network. For example * pass "lxc.net.[i]" to retrieve all configuration items associated with * the network associated with index [i]. */ -extern int lxc_list_net(struct lxc_conf *c, const char *key, char *retv, - int inlen) -__access_rw(3, 4); +__hidden extern int lxc_list_net(struct lxc_conf *c, const char *key, char *retv, int inlen) + __access_rw(3, 4); -extern int lxc_config_read(const char *file, struct lxc_conf *conf, - bool from_include); +__hidden extern int lxc_config_read(const char *file, struct lxc_conf *conf, bool from_include); -extern int append_unexp_config_line(const char *line, struct lxc_conf *conf); +__hidden extern int append_unexp_config_line(const char *line, struct lxc_conf *conf); -extern int lxc_config_define_add(struct lxc_list *defines, char* arg); +__hidden extern int lxc_config_define_add(struct lxc_list *defines, char *arg); -extern bool lxc_config_define_load(struct lxc_list *defines, - struct lxc_container *c); +__hidden extern bool lxc_config_define_load(struct lxc_list *defines, struct lxc_container *c); -extern void lxc_config_define_free(struct lxc_list *defines); +__hidden extern void lxc_config_define_free(struct lxc_list *defines); /* needed for lxc-attach */ -extern signed long lxc_config_parse_arch(const char *arch); +__hidden extern signed long lxc_config_parse_arch(const char *arch); -extern int lxc_fill_elevated_privileges(char *flaglist, int *flags); +__hidden extern int lxc_fill_elevated_privileges(char *flaglist, int *flags); -extern int lxc_clear_config_item(struct lxc_conf *c, const char *key); +__hidden extern int lxc_clear_config_item(struct lxc_conf *c, const char *key); -extern int write_config(int fd, const struct lxc_conf *conf); +__hidden extern int write_config(int fd, const struct lxc_conf *conf); -extern bool do_append_unexp_config_line(struct lxc_conf *conf, const char *key, - const char *v); +__hidden extern bool do_append_unexp_config_line(struct lxc_conf *conf, const char *key, + const char *v); /* These are used when cloning a container */ -extern void clear_unexp_config_line(struct lxc_conf *conf, const char *key, - bool rm_subkeys); +__hidden extern void clear_unexp_config_line(struct lxc_conf *conf, const char *key, bool rm_subkeys); -extern bool clone_update_unexp_hooks(struct lxc_conf *conf, const char *oldpath, - const char *newpath, const char *oldname, - const char *newmame); +__hidden extern bool clone_update_unexp_hooks(struct lxc_conf *conf, const char *oldpath, + const char *newpath, const char *oldname, + const char *newmame); -bool clone_update_unexp_ovl_paths(struct lxc_conf *conf, const char *oldpath, - const char *newpath, const char *oldname, - const char *newname, const char *ovldir); +__hidden extern bool clone_update_unexp_ovl_paths(struct lxc_conf *conf, const char *oldpath, + const char *newpath, const char *oldname, + const char *newname, const char *ovldir); -extern bool network_new_hwaddrs(struct lxc_conf *conf); +__hidden extern bool network_new_hwaddrs(struct lxc_conf *conf); -extern int add_elem_to_mount_list(const char *value, struct lxc_conf *lxc_conf); +__hidden extern int add_elem_to_mount_list(const char *value, struct lxc_conf *lxc_conf); #endif /* __LXC_CONFILE_H */ diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 0380f89b5..78a7b1aa0 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -8,12 +8,25 @@ lxc_test_attach_SOURCES = attach.c lxc_test_basic_SOURCES = basic.c lxc_test_cgpath_SOURCES = cgpath.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ + ../lxc/caps.c ../lxc/caps.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ + ../lxc/conf.c ../lxc/conf.h \ + ../lxc/confile.c ../lxc/confile.h \ + ../lxc/network.c ../lxc/network.h \ + ../lxc/nl.c ../lxc/nl.h \ ../lxc/string_utils.c ../lxc/string_utils.h lxc_test_clonetest_SOURCES = clonetest.c lxc_test_concurrent_SOURCES = concurrent.c -lxc_test_config_jump_table_SOURCES = config_jump_table.c lxctest.h +lxc_test_config_jump_table_SOURCES = config_jump_table.c \ + lxctest.h \ + ../lxc/af_unix.c ../lxc/af_unix.h \ + ../lxc/caps.c ../lxc/caps.h \ + ../lxc/conf.c ../lxc/conf.h \ + ../lxc/confile.c ../lxc/confile.h \ + ../lxc/network.c ../lxc/network.h \ + ../lxc/nl.c ../lxc/nl.h \ + ../lxc/string_utils.c ../lxc/string_utils.h lxc_test_console_SOURCES = console.c lxc_test_console_log_SOURCES = console_log.c lxctest.h lxc_test_containertests_SOURCES = containertests.c @@ -56,12 +69,15 @@ AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ -DLXCPATH=\"$(LXCPATH)\" \ -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \ -DLXCINITDIR=\"$(LXCINITDIR)\" \ + -DLIBEXECDIR=\"$(LIBEXECDIR)\" \ -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \ -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \ + -DSBINDIR=\"$(SBINDIR)\" \ -I $(top_srcdir)/src \ -I $(top_srcdir)/src/lxc \ -I $(top_srcdir)/src/lxc/cgroups \ -I $(top_srcdir)/src/lxc/tools \ + -I $(top_srcdir)/src/lxc/storage \ -pthread if ENABLE_APPARMOR