]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
add some TRACE/ERROR reporting
authorTycho Andersen <tycho@tycho.ws>
Tue, 8 May 2018 15:43:19 +0000 (09:43 -0600)
committerTycho Andersen <tycho@tycho.ws>
Wed, 9 May 2018 14:36:02 +0000 (14:36 +0000)
The errors in execute_start are important because nothing actually prints
out what error if any there was in these cases, so you're left with an
empty log.

The TRACE logs are simply to tell you which version of start lxc chose to
invoke: exec or start.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
src/lxc/execute.c
src/lxc/start.c

index 79a97cf88a05554c47758efebb69bb3cd1892758..597233908661781560e68c69c372db84297c8741 100644 (file)
@@ -58,11 +58,15 @@ static int execute_start(struct lxc_handler *handler, void* data)
                argc_add += 2;
 
        argv = malloc((argc + argc_add) * sizeof(*argv));
-       if (!argv)
+       if (!argv) {
+               SYSERROR("Allocating init args failed");
                goto out1;
+       }
 
-       if (!my_args->init_path)
+       if (!my_args->init_path) {
+               ERROR("Init path missing");
                goto out2;
+       }
 
        argv[i++] = my_args->init_path;
 
@@ -139,6 +143,7 @@ int lxc_execute(const char *name, char *const argv[], int quiet,
 {
        struct execute_args args = {.argv = argv, .quiet = quiet};
 
+       TRACE("Doing lxc_execute");
        handler->conf->is_execute = 1;
        return __lxc_start(name, handler, &execute_start_ops, &args, lxcpath,
                           backgrounded, error_num);
index d7f079979e8c21b02e66a7d6a9fe42c2936db0c4..ce5cb3366e1d75a90566b7dc4bbf16a3d9e89b17 100644 (file)
@@ -1971,6 +1971,7 @@ int lxc_start(const char *name, char *const argv[], struct lxc_handler *handler,
                .argv = argv,
        };
 
+       TRACE("Doing lxc_start");
        return __lxc_start(name, handler, &start_ops, &start_arg, lxcpath, backgrounded, error_num);
 }