]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tools: lxc-stop: share internal API symbols
author2xsec <dh48.jeong@samsung.com>
Thu, 28 Jun 2018 13:54:27 +0000 (22:54 +0900)
committer2xsec <dh48.jeong@samsung.com>
Thu, 28 Jun 2018 13:54:27 +0000 (22:54 +0900)
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/Makefile.am
src/lxc/tools/lxc_stop.c

index 852db6ee1837a90b1aa30fb77daa291adda8c4dc..acdb29dc4c65ce0949eed9c3e461e2144c2cdf54 100644 (file)
@@ -279,7 +279,7 @@ lxc_monitor_SOURCES = tools/lxc_monitor.c tools/arguments.c tools/tool_utils.c
 lxc_ls_SOURCES = tools/lxc_ls.c tools/arguments.c tools/tool_utils.c
 lxc_copy_SOURCES = tools/lxc_copy.c tools/arguments.c tools/tool_utils.c
 lxc_start_SOURCES = tools/lxc_start.c tools/arguments.c
-lxc_stop_SOURCES = tools/lxc_stop.c tools/arguments.c tools/tool_utils.c
+lxc_stop_SOURCES = tools/lxc_stop.c tools/arguments.c
 lxc_top_SOURCES = tools/lxc_top.c tools/arguments.c tools/tool_utils.c
 lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c tools/arguments.c tools/tool_utils.c
 lxc_unshare_SOURCES = tools/lxc_unshare.c tools/arguments.c tools/tool_utils.c
index 7416116d68f9b700f7a2a43cd4292786685cba9d..c1b6a476377dec977847d15ea8bc199888de4137 100644 (file)
 #include <lxc/lxccontainer.h>
 
 #include "arguments.h"
-#include "tool_utils.h"
+#include "log.h"
+#include "utils.h"
 
 #define OPT_NO_LOCK OPT_USAGE + 1
 #define OPT_NO_KILL OPT_USAGE + 2
 
+lxc_log_define(lxc_stop, lxc);
+
 static int my_parser(struct lxc_arguments *args, int c, char *arg)
 {
        switch (c) {
@@ -130,33 +133,33 @@ int main(int argc, char *argv[])
 
        /* some checks */
        if (!my_args.hardstop && my_args.timeout < -1) {
-               lxc_error(&my_args, "Invalid timeout");
+               ERROR("Invalid timeout");
                exit(ret);
        }
 
        if (my_args.hardstop && my_args.nokill) {
-               lxc_error(&my_args, "-k can't be used with --nokill");
+               ERROR("-k can't be used with --nokill");
                exit(ret);
        }
 
        if (my_args.hardstop && my_args.reboot) {
-               lxc_error(&my_args, "-k can't be used with -r");
+               ERROR("-k can't be used with -r");
                exit(ret);
        }
 
        if (my_args.hardstop && my_args.timeout) {
-               lxc_error(&my_args, "-k doesn't allow timeouts");
+               ERROR("-k doesn't allow timeouts");
                exit(ret);
        }
 
        if (my_args.nolock && !my_args.hardstop) {
-               lxc_error(&my_args, "--nolock may only be used with -k");
+               ERROR("--nolock may only be used with -k");
                exit(ret);
        }
 
        c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
        if (!c) {
-               lxc_error(&my_args, "Error opening container");
+               ERROR("Error opening container");
                goto out;
        }
 
@@ -164,24 +167,24 @@ int main(int argc, char *argv[])
                c->clear_config(c);
 
                if (!c->load_config(c, my_args.rcfile)) {
-                       lxc_error(&my_args, "Failed to load rcfile");
+                       ERROR("Failed to load rcfile");
                        goto out;
                }
 
                c->configfile = strdup(my_args.rcfile);
                if (!c->configfile) {
-                       lxc_error(&my_args, "Out of memory setting new config filename");
+                       ERROR("Out of memory setting new config filename");
                        goto out;
                }
        }
 
        if (!c->may_control(c)) {
-               lxc_error(&my_args, "Insufficent privileges to control %s", c->name);
+               ERROR("Insufficent privileges to control %s", c->name);
                goto out;
        }
 
        if (!c->is_running(c)) {
-               lxc_error(&my_args, "%s is not running", c->name);
+               ERROR("%s is not running", c->name);
 
                /* Per our manpage we need to exit with exit code:
                 * 2: The specified container exists but was not running.