From: Christian Brauner Date: Sun, 1 Jul 2018 20:16:08 +0000 (+0200) Subject: tree-wide: remove unneeded log prefixes X-Git-Tag: lxc-3.1.0~219^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac2cecc4b8727a970b805812efbe925307132cc4;p=thirdparty%2Flxc.git tree-wide: remove unneeded log prefixes Signed-off-by: Christian Brauner --- diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c index 002f944ce..86f1fe9fd 100644 --- a/src/lxc/af_unix.c +++ b/src/lxc/af_unix.c @@ -40,7 +40,7 @@ #include "include/strlcpy.h" #endif -lxc_log_define(lxc_af_unix, lxc); +lxc_log_define(af_unix, lxc); int lxc_abstract_unix_open(const char *path, int type, int flags) { diff --git a/src/lxc/attach.c b/src/lxc/attach.c index bc98f67c5..afb4e0bc0 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -87,7 +87,7 @@ #define MS_SLAVE (1 << 19) #endif -lxc_log_define(lxc_attach, lxc); +lxc_log_define(attach, lxc); /* /proc/pid-to-str/status\0 = (5 + 21 + 7 + 1) */ #define __PROC_STATUS_LEN (5 + (LXC_NUMSTRLEN64) + 7 + 1) diff --git a/src/lxc/caps.c b/src/lxc/caps.c index 7b1848f63..ae5d7ef16 100644 --- a/src/lxc/caps.c +++ b/src/lxc/caps.c @@ -34,7 +34,7 @@ #include "caps.h" #include "log.h" -lxc_log_define(lxc_caps, lxc); +lxc_log_define(caps, lxc); #if HAVE_LIBCAP diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 3cc9f9f62..6d472d6a7 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -66,7 +66,7 @@ #include "include/strlcat.h" #endif -lxc_log_define(lxc_cgfsng, lxc); +lxc_log_define(cgfsng, cgroup); static void free_string_list(char **clist) { diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c index cd67c3c5d..754fdcae3 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -30,7 +30,7 @@ #include "log.h" #include "start.h" -lxc_log_define(lxc_cgroup, lxc); +lxc_log_define(cgroup, lxc); extern struct cgroup_ops *cgfsng_ops_init(void); diff --git a/src/lxc/commands.c b/src/lxc/commands.c index 22275277b..618b3089d 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -76,7 +76,7 @@ * container. */ -lxc_log_define(lxc_commands, lxc); +lxc_log_define(commands, lxc); static const char *lxc_cmd_str(lxc_cmd_t cmd) { diff --git a/src/lxc/commands_utils.c b/src/lxc/commands_utils.c index 03e481f09..f27880032 100644 --- a/src/lxc/commands_utils.c +++ b/src/lxc/commands_utils.c @@ -38,7 +38,7 @@ #include "state.h" #include "utils.h" -lxc_log_define(lxc_commands_utils, lxc); +lxc_log_define(commands_utils, lxc); int lxc_cmd_sock_rcv_state(int state_client_fd, int timeout) { diff --git a/src/lxc/conf.c b/src/lxc/conf.c index bb483522d..5f060fe18 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -118,7 +118,7 @@ #define MS_LAZYTIME (1<<25) #endif -lxc_log_define(lxc_conf, lxc); +lxc_log_define(conf, lxc); /* The lxc_conf of the container currently being worked on in an API call. * This is used in the error calls. diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 7cb1fbb16..4365264e9 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -73,7 +73,7 @@ #include "include/strlcat.h" #endif -lxc_log_define(lxc_confile, lxc); +lxc_log_define(confile, lxc); #define lxc_config_define(name) \ static int set_config_##name(const char *, const char *, \ diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c index a68c6ffd0..8100cf741 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -40,7 +40,7 @@ #include "include/strlcpy.h" #endif -lxc_log_define(lxc_confile_utils, lxc); +lxc_log_define(confile_utils, lxc); int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, unsigned long *hostid, unsigned long *range) diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 41b0c027f..c36421627 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -63,7 +63,7 @@ #define CRIU_IN_FLIGHT_SUPPORT "2.4" #define CRIU_EXTERNAL_NOT_VETH "2.8" -lxc_log_define(lxc_criu, lxc); +lxc_log_define(criu, lxc); struct criu_opts { /* the thing to hook to stdout and stderr for logging */ diff --git a/src/lxc/error.c b/src/lxc/error.c index 9147a6afb..769dedc40 100644 --- a/src/lxc/error.c +++ b/src/lxc/error.c @@ -28,7 +28,7 @@ #include "error.h" #include "log.h" -lxc_log_define(lxc_error, lxc); +lxc_log_define(error, lxc); /*---------------------------------------------------------------------------*/ /* lxc_error_set_and_log diff --git a/src/lxc/execute.c b/src/lxc/execute.c index 1a87b2321..d01df6b2e 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -34,7 +34,7 @@ #include "start.h" #include "utils.h" -lxc_log_define(lxc_execute, lxc_start); +lxc_log_define(execute, start); static int execute_start(struct lxc_handler *handler, void* data) { diff --git a/src/lxc/freezer.c b/src/lxc/freezer.c index 5665aee8e..2103b50b9 100644 --- a/src/lxc/freezer.c +++ b/src/lxc/freezer.c @@ -40,7 +40,7 @@ #include "parse.h" #include "state.h" -lxc_log_define(lxc_freezer, lxc); +lxc_log_define(freezer, lxc); static int do_freeze_thaw(bool freeze, const char *name, const char *lxcpath) { diff --git a/src/lxc/initutils.c b/src/lxc/initutils.c index 4ca2ce197..6ab39a7da 100644 --- a/src/lxc/initutils.c +++ b/src/lxc/initutils.c @@ -31,7 +31,7 @@ #include "include/strlcpy.h" #endif -lxc_log_define(lxc_initutils, lxc); +lxc_log_define(initutils, lxc); static char *copy_global_config_value(char *p) { diff --git a/src/lxc/log.c b/src/lxc/log.c index a3ce9f367..8e7de7c8d 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -66,7 +66,7 @@ static char log_prefix[LXC_LOG_PREFIX_SIZE] = "lxc"; static char *log_fname = NULL; static char *log_vmname = NULL; -lxc_log_define(lxc_log, lxc); +lxc_log_define(log, lxc); static int lxc_log_priority_to_syslog(int priority) { diff --git a/src/lxc/lsm/apparmor.c b/src/lxc/lsm/apparmor.c index 793d13f76..1507917c8 100644 --- a/src/lxc/lsm/apparmor.c +++ b/src/lxc/lsm/apparmor.c @@ -33,7 +33,7 @@ #include "conf.h" #include "utils.h" -lxc_log_define(lxc_apparmor, lxc); +lxc_log_define(apparmor, lsm); /* set by lsm_apparmor_drv_init if true */ static int aa_enabled = 0; diff --git a/src/lxc/lsm/lsm.c b/src/lxc/lsm/lsm.c index 3f71cdd73..f4500ae20 100644 --- a/src/lxc/lsm/lsm.c +++ b/src/lxc/lsm/lsm.c @@ -32,7 +32,7 @@ #include "log.h" #include "lsm.h" -lxc_log_define(lxc_lsm, lxc); +lxc_log_define(lsm, lxc); static struct lsm_drv *drv = NULL; diff --git a/src/lxc/lsm/selinux.c b/src/lxc/lsm/selinux.c index 1d8ce4cba..c88c18e3d 100644 --- a/src/lxc/lsm/selinux.c +++ b/src/lxc/lsm/selinux.c @@ -36,7 +36,7 @@ #define DEFAULT_LABEL "unconfined_t" -lxc_log_define(lxc_lsm_selinux, lxc); +lxc_log_define(selinux, lsm); /* * selinux_process_label_get: Get SELinux context of a process diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index c5ea78770..ce01f13e9 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -104,7 +104,7 @@ static int faccessat(int __fd, const char *__file, int __type, int __flag) } #endif -lxc_log_define(lxc_container, lxc); +lxc_log_define(lxccontainer, lxc); static bool do_lxcapi_destroy(struct lxc_container *c); static const char *lxcapi_get_config_path(struct lxc_container *c); diff --git a/src/lxc/lxclock.c b/src/lxc/lxclock.c index 08c96e0b1..29675fb59 100644 --- a/src/lxc/lxclock.c +++ b/src/lxc/lxclock.c @@ -40,7 +40,7 @@ #define MAX_STACKDEPTH 25 -lxc_log_define(lxc_lock, lxc); +lxc_log_define(lxclock, lxc); #ifdef MUTEX_DEBUGGING static pthread_mutex_t thread_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index 4bbf679db..d9f10c40b 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -54,7 +54,7 @@ #include "include/strlcpy.h" #endif -lxc_log_define(lxc_monitor, lxc); +lxc_log_define(monitor, lxc); /* routines used by monitor publishers (containers) */ int lxc_monitor_fifo_name(const char *lxcpath, char *fifo_path, size_t fifo_path_sz, diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c index a169f83de..2459c9d2e 100644 --- a/src/lxc/namespace.c +++ b/src/lxc/namespace.c @@ -37,7 +37,7 @@ #include "namespace.h" #include "utils.h" -lxc_log_define(lxc_namespace, lxc); +lxc_log_define(namespace, lxc); struct clone_arg { int (*fn)(void *); diff --git a/src/lxc/network.c b/src/lxc/network.c index e59b85d62..c9497afa4 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -95,7 +95,7 @@ #define IFLA_MACVLAN_MODE 1 #endif -lxc_log_define(lxc_network, lxc); +lxc_log_define(network, lxc); typedef int (*instantiate_cb)(struct lxc_handler *, struct lxc_netdev *); diff --git a/src/lxc/parse.c b/src/lxc/parse.c index a1025c5af..bc209347c 100644 --- a/src/lxc/parse.c +++ b/src/lxc/parse.c @@ -35,7 +35,7 @@ #include "utils.h" #include "log.h" -lxc_log_define(lxc_parse, lxc); +lxc_log_define(parse, lxc); void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c index 81abf62ee..c8f2b3f3b 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -42,7 +42,7 @@ #define MIPS_ARCH_N64 lxc_seccomp_arch_mips64 #endif -lxc_log_define(lxc_seccomp, lxc); +lxc_log_define(seccomp, lxc); static int parse_config_v1(FILE *f, char *line, size_t *line_bufsz, struct lxc_conf *conf) { diff --git a/src/lxc/start.c b/src/lxc/start.c index a0bcd80bb..953722261 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -94,7 +94,7 @@ #include "include/strlcpy.h" #endif -lxc_log_define(lxc_start, lxc); +lxc_log_define(start, lxc); extern void mod_all_rdeps(struct lxc_container *c, bool inc); static bool do_destroy_container(struct lxc_handler *handler); diff --git a/src/lxc/state.c b/src/lxc/state.c index 12fd65386..3ccbe583a 100644 --- a/src/lxc/state.c +++ b/src/lxc/state.c @@ -44,7 +44,7 @@ #include "monitor.h" #include "start.h" -lxc_log_define(lxc_state, lxc); +lxc_log_define(state, lxc); static const char *const strstate[] = { "STOPPED", "STARTING", "RUNNING", "STOPPING", diff --git a/src/lxc/sync.c b/src/lxc/sync.c index 62512eec7..53fae06c0 100644 --- a/src/lxc/sync.c +++ b/src/lxc/sync.c @@ -32,7 +32,7 @@ #include "log.h" #include "start.h" -lxc_log_define(lxc_sync, lxc); +lxc_log_define(sync, lxc); static int __sync_wait(int fd, int sequence) { diff --git a/src/lxc/tools/arguments.c b/src/lxc/tools/arguments.c index 5e2387a9e..daff4d816 100644 --- a/src/lxc/tools/arguments.c +++ b/src/lxc/tools/arguments.c @@ -38,6 +38,7 @@ #include "arguments.h" #include "namespace.h" +#include "initutils.h" static int build_shortopts(const struct option *a_options, char *a_shortopts, size_t a_size) @@ -186,13 +187,6 @@ static int lxc_arguments_lxcpath_add(struct lxc_arguments *args, return 0; } -void remove_trailing_slashes(char *p) -{ - int l = strlen(p); - while (--l >= 0 && (p[l] == '/' || p[l] == '\n')) - p[l] = '\0'; -} - extern int lxc_arguments_parse(struct lxc_arguments *args, int argc, char *const argv[]) { diff --git a/src/lxc/utils.c b/src/lxc/utils.c index e2ee8229d..6bb05df00 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -67,7 +67,7 @@ #define O_NOFOLLOW 00400000 #endif -lxc_log_define(lxc_utils, lxc); +lxc_log_define(utils, lxc); /* * if path is btrfs, tries to remove it and any subvolumes beneath it