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.
Reported-by: Ciprian Dorin, Craciun <ciprian.craciun@gmail.com>
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
#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)
{
#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)
{
#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)
{
#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)
{
#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
#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)
{
#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)
{
#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)
{
#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)
{