]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf, start: improve log output
authorChristian Brauner <christian.brauner@canonical.com>
Thu, 27 Oct 2016 19:09:27 +0000 (21:09 +0200)
committerChristian Brauner <christian.brauner@canonical.com>
Sat, 19 Nov 2016 04:11:30 +0000 (05:11 +0100)
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/conf.c
src/lxc/start.c

index 4c11161e6243181c7f24a0f59c04fd4032d6e9ef..367a9447520fed2e97eb02ed626df246a3706b30 100644 (file)
@@ -3047,7 +3047,7 @@ int lxc_assign_network(const char *lxcpath, char *lxcname,
                        return -1;
                }
 
-               DEBUG("move '%s' to '%d'", netdev->name, pid);
+               DEBUG("move '%s'/'%s' to '%d': .", ifname, netdev->name, pid);
        }
 
        return 0;
index 8bc7f732fc889b133a575da9988fbd8e77463e65..cc48962449c7bb94346c6d9f22dc3c5871f50974 100644 (file)
@@ -769,6 +769,8 @@ static int do_start(void *data)
                if (ret < 0) {
                        SYSERROR("Error unsharing network namespace");
                        goto out_warn_father;
+               } else {
+                       INFO("Unshared NET namespace.");
                }
        }
 
@@ -1055,33 +1057,35 @@ static int recv_ttys_from_child(struct lxc_handler *handler)
 void resolve_clone_flags(struct lxc_handler *handler)
 {
        handler->clone_flags = CLONE_NEWPID | CLONE_NEWNS;
+       INFO("Adding CLONE_NEWPID to clone flags.");
+       INFO("Adding CLONE_NEWNS to clone flags.");
 
        if (!lxc_list_empty(&handler->conf->id_map)) {
-               INFO("Cloning a new USER namespace");
+               INFO("Adding CLONE_NEWUSER to clone flags.");
                handler->clone_flags |= CLONE_NEWUSER;
        }
 
        if (handler->conf->inherit_ns_fd[LXC_NS_NET] == -1) {
                if (!lxc_requests_empty_network(handler)) {
-                       INFO("Cloning a new NET namespace");
+                       INFO("Adding CLONE_NEWNET to clone flags.");
                        handler->clone_flags |= CLONE_NEWNET;
                }
        } else {
-               INFO("Inheriting a NET namespace");
+               INFO("Inheriting a NET namespace.");
        }
 
        if (handler->conf->inherit_ns_fd[LXC_NS_IPC] == -1) {
-               INFO("Cloning a new IPC namespace");
+               INFO("Adding CLONE_NEWIPC to clone flags.");
                handler->clone_flags |= CLONE_NEWIPC;
        } else {
-               INFO("Inheriting an IPC namespace");
+               INFO("Inheriting an IPC namespace.");
        }
 
        if (handler->conf->inherit_ns_fd[LXC_NS_UTS] == -1) {
-               INFO("Cloning a new UTS namespace");
+               INFO("Adding CLONE_NEWUTS to clone flags.");
                handler->clone_flags |= CLONE_NEWUTS;
        } else {
-               INFO("Inheriting a UTS namespace");
+               INFO("Inheriting a UTS namespace.");
        }
 }
 
@@ -1188,8 +1192,10 @@ static int lxc_spawn(struct lxc_handler *handler)
                flags &= ~CLONE_NEWNET;
        handler->pid = lxc_clone(do_start, handler, flags);
        if (handler->pid < 0) {
-               SYSERROR("failed to fork into a new namespace");
+               SYSERROR("Failed to fork into a set of new namespaces.");
                goto out_delete_net;
+       } else {
+               INFO("Cloned a set of new namespaces.");
        }
 
        if (!preserve_ns(handler->nsfd, handler->clone_flags | preserve_mask, handler->pid, &errmsg)) {
@@ -1368,8 +1374,10 @@ int __lxc_start(const char *name, struct lxc_conf *conf,
                /* if the backing store is a device, mount it here and now */
                if (rootfs_is_blockdev(conf)) {
                        if (unshare(CLONE_NEWNS) < 0) {
-                               ERROR("Error unsharing mounts");
+                               ERROR("Error unsharing MOUNT namespace.");
                                goto out_fini_nonet;
+                       } else {
+                               INFO("Unshared MOUNT namespace.");
                        }
                        remount_all_slave();
                        if (do_rootfs_setup(conf, name, lxcpath) < 0) {