[lxc-devel] [PATCH] lxc: use different log categories in commands

Cedric Le Goater clg at fr.ibm.com
Tue Jan 12 15:44:19 UTC 2010


lxc_<cmd>.c and <cmd>.c files use the same log category : lxc_<cmd>.
The symbol is multiply defined and linking statically lxc commands is
not possible.

The patch introduces new log categories with a '_ui' suffix to
differentiate the command line interface from the library routine.

Signed-off-by: Cedric Le Goater <clg at fr.ibm.com>
---
 src/lxc/lxc_cgroup.c     |    2 +-
 src/lxc/lxc_checkpoint.c |    2 +-
 src/lxc/lxc_console.c    |    2 +-
 src/lxc/lxc_execute.c    |    2 +-
 src/lxc/lxc_monitor.c    |    2 +-
 src/lxc/lxc_restart.c    |    2 +-
 src/lxc/lxc_start.c      |    2 +-
 src/lxc/lxc_unshare.c    |    2 +-
 src/lxc/lxc_wait.c       |    2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index f394d26..d5aa5aa 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -31,7 +31,7 @@
 
 #include "arguments.h"
 
-lxc_log_define(lxc_cgroup, lxc);
+lxc_log_define(lxc_cgroup_ui, lxc_cgroup);
 
 static int my_checker(const struct lxc_arguments* args)
 {
diff --git a/src/lxc/lxc_checkpoint.c b/src/lxc/lxc_checkpoint.c
index bf554dd..43c4a4a 100644
--- a/src/lxc/lxc_checkpoint.c
+++ b/src/lxc/lxc_checkpoint.c
@@ -35,7 +35,7 @@
 #include "arguments.h"
 #include "config.h"
 
-lxc_log_define(lxc_checkpoint, lxc);
+lxc_log_define(lxc_checkpoint_ui, lxc_checkpoint);
 
 static int my_checker(const struct lxc_arguments* args)
 {
diff --git a/src/lxc/lxc_console.c b/src/lxc/lxc_console.c
index d6ba7e4..2ee1c48 100644
--- a/src/lxc/lxc_console.c
+++ b/src/lxc/lxc_console.c
@@ -44,7 +44,7 @@
 
 #include "arguments.h"
 
-lxc_log_define(lxc_console, lxc);
+lxc_log_define(lxc_console_ui, lxc_console);
 
 static int my_parser(struct lxc_arguments* args, int c, char* arg)
 {
diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c
index 50fec10..1046924 100644
--- a/src/lxc/lxc_execute.c
+++ b/src/lxc/lxc_execute.c
@@ -39,7 +39,7 @@
 #include "arguments.h"
 #include "config.h"
 
-lxc_log_define(lxc_execute, lxc);
+lxc_log_define(lxc_execute_ui, lxc_start);
 
 static int my_checker(const struct lxc_arguments* args)
 {
diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c
index 7d14188..314d4a5 100644
--- a/src/lxc/lxc_monitor.c
+++ b/src/lxc/lxc_monitor.c
@@ -33,7 +33,7 @@
 #include <lxc/monitor.h>
 #include "arguments.h"
 
-lxc_log_define(monitor, lxc);
+lxc_log_define(lxc_monitor_ui, lxc_monitor);
 
 static const struct option my_longopts[] = {
 	LXC_COMMON_OPTIONS
diff --git a/src/lxc/lxc_restart.c b/src/lxc/lxc_restart.c
index b9eaea6..982220a 100644
--- a/src/lxc/lxc_restart.c
+++ b/src/lxc/lxc_restart.c
@@ -35,7 +35,7 @@
 #include "confile.h"
 #include "arguments.h"
 
-lxc_log_define(lxc_restart, lxc);
+lxc_log_define(lxc_restart_ui, lxc_restart);
 
 static int my_checker(const struct lxc_arguments* args)
 {
diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c
index fdd3b15..9cde900 100644
--- a/src/lxc/lxc_start.c
+++ b/src/lxc/lxc_start.c
@@ -48,7 +48,7 @@
 #include "confile.h"
 #include "arguments.h"
 
-lxc_log_define(lxc_start, lxc);
+lxc_log_define(lxc_start_ui, lxc_start);
 
 static int my_parser(struct lxc_arguments* args, int c, char* arg)
 {
diff --git a/src/lxc/lxc_unshare.c b/src/lxc/lxc_unshare.c
index 4639687..9414494 100644
--- a/src/lxc/lxc_unshare.c
+++ b/src/lxc/lxc_unshare.c
@@ -35,7 +35,7 @@
 #include <lxc/log.h>
 #include <lxc/namespace.h>
 
-lxc_log_define(lxc_unshare, lxc);
+lxc_log_define(lxc_unshare_ui, lxc);
 
 void usage(char *cmd)
 {
diff --git a/src/lxc/lxc_wait.c b/src/lxc/lxc_wait.c
index a5199e2..a58e0c8 100644
--- a/src/lxc/lxc_wait.c
+++ b/src/lxc/lxc_wait.c
@@ -31,7 +31,7 @@
 #include <lxc/monitor.h>
 #include "arguments.h"
 
-lxc_log_define(lxc_wait, lxc);
+lxc_log_define(lxc_wait_ui, lxc_monitor);
 
 static int my_checker(const struct lxc_arguments* args)
 {
-- 
1.6.2.5





More information about the lxc-devel mailing list