]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: lxc-freeze: share internal API symbols
author2xsec <dh48.jeong@samsung.com>
Thu, 28 Jun 2018 14:00:03 +0000 (23:00 +0900)
committer2xsec <dh48.jeong@samsung.com>
Thu, 28 Jun 2018 14:00:03 +0000 (23:00 +0900)
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/Makefile.am
src/lxc/tools/lxc_freeze.c

index acdb29dc4c65ce0949eed9c3e461e2144c2cdf54..4afb3f0c76c8b8292ce3e1bcfd058fbdd9102859 100644 (file)
@@ -273,7 +273,7 @@ lxc_console_SOURCES = tools/lxc_console.c tools/arguments.c tools/tool_utils.c
 lxc_destroy_SOURCES = tools/lxc_destroy.c tools/arguments.c tools/tool_utils.c
 lxc_device_SOURCES = tools/lxc_device.c tools/arguments.c tools/tool_utils.c
 lxc_execute_SOURCES = tools/lxc_execute.c tools/arguments.c tools/tool_utils.c
-lxc_freeze_SOURCES = tools/lxc_freeze.c tools/arguments.c tools/tool_utils.c
+lxc_freeze_SOURCES = tools/lxc_freeze.c tools/arguments.c
 lxc_info_SOURCES = tools/lxc_info.c tools/arguments.c tools/tool_utils.c
 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
index 19e758c6f6fcb379a44131eb36f859ee9865d064..88e1f38b8ae78dbfec895270dbd6e43e7d876150 100644 (file)
@@ -32,6 +32,9 @@
 #include <lxc/lxccontainer.h>
 
 #include "arguments.h"
+#include "log.h"
+
+lxc_log_define(lxc_freeze, lxc);
 
 static const struct option my_longopts[] = {
        LXC_COMMON_OPTIONS
@@ -75,33 +78,35 @@ int main(int argc, char *argv[])
 
        c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
        if (!c) {
-               lxc_error(&my_args, "No such container: %s:%s", my_args.lxcpath[0], my_args.name);
+               ERROR("No such container: %s:%s", my_args.lxcpath[0], my_args.name);
                exit(EXIT_FAILURE);
        }
 
        if (my_args.rcfile) {
                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");
                        lxc_container_put(c);
                        exit(EXIT_FAILURE);
                }
+
                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");
                        lxc_container_put(c);
                        exit(EXIT_FAILURE);
                }
        }
 
        if (!c->may_control(c)) {
-               lxc_error(&my_args, "Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
+               ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
                lxc_container_put(c);
                exit(EXIT_FAILURE);
        }
 
        if (!c->freeze(c)) {
-               lxc_error(&my_args, "Failed to freeze %s:%s", my_args.lxcpath[0], my_args.name);
+               ERROR("Failed to freeze %s:%s", my_args.lxcpath[0], my_args.name);
                lxc_container_put(c);
                exit(EXIT_FAILURE);
        }