]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
{_}lxc_start: remove "name" argument
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 15 Mar 2020 14:45:54 +0000 (15:45 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 15 Mar 2020 14:45:54 +0000 (15:45 +0100)
as it's directly available in the handler itself.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/execute.c
src/lxc/lxc.h
src/lxc/lxccontainer.c
src/lxc/start.c
src/lxc/start.h

index 1cff0eda1b641f106477f020392435c29c272ffd..7dd835862f4b610a67c91a689180c70427248d8e 100644 (file)
@@ -96,6 +96,6 @@ int lxc_execute(const char *name, char *const argv[], int quiet,
 
        TRACE("Doing lxc_execute");
        handler->conf->is_execute = true;
-       return __lxc_start(name, handler, &execute_start_ops, &args, lxcpath,
+       return __lxc_start(handler, &execute_start_ops, &args, lxcpath,
                           daemonize, error_num);
 }
index a58ca5f1ba45770721c55ff3632e4412ea25696d..630eff0b49c27dca62f7423f1f24ffe0db02a6ee 100644 (file)
@@ -27,15 +27,13 @@ struct lxc_handler;
 
 /*
  * Start the specified command inside a system container
- * @name         : the name of the container
  * @argv         : an array of char * corresponding to the command line
  * @conf         : configuration
  * @daemonize    : whether or not the container is daemonized
  * Returns 0 on success, < 0 otherwise
  */
-extern int lxc_start(const char *name, char *const argv[],
-                    struct lxc_handler *handler, const char *lxcpath,
-                    bool daemonize, int *error_num);
+extern int lxc_start(char *const argv[], struct lxc_handler *handler,
+                    const char *lxcpath, bool daemonize, int *error_num);
 
 /*
  * Start the specified command inside an application container
index 06a1eb9b610a9116471ccb7bcf7b1dcb244beeb7..55eaf50b3fff78b5bef09a88443f1a16eff34fbf 100644 (file)
@@ -1117,8 +1117,8 @@ reboot:
                ret = lxc_execute(c->name, argv, 1, handler, c->config_path,
                                  c->daemonize, &c->error_num);
        else
-               ret = lxc_start(c->name, argv, handler, c->config_path,
-                               c->daemonize, &c->error_num);
+               ret = lxc_start(argv, handler, c->config_path, c->daemonize,
+                               &c->error_num);
 
        if (conf->reboot == REBOOT_REQ) {
                INFO("Container requested reboot");
index d33fd4e34617ab94fb940e18b6cdc5df80c9e0a8..08f336cf04ed5382d7a1dfa58cd6ae13d1c59b6b 100644 (file)
@@ -1879,11 +1879,11 @@ out_sync_fini:
        return -1;
 }
 
-int __lxc_start(const char *name, struct lxc_handler *handler,
-               struct lxc_operations* ops, void *data, const char *lxcpath,
-               bool daemonize, int *error_num)
+int __lxc_start(struct lxc_handler *handler, struct lxc_operations *ops,
+               void *data, const char *lxcpath, bool daemonize, int *error_num)
 {
        int ret, status;
+       const char *name = handler->name;
        struct lxc_conf *conf = handler->conf;
        struct cgroup_ops *cgroup_ops;
 
@@ -2052,7 +2052,7 @@ static struct lxc_operations start_ops = {
        .post_start = post_start
 };
 
-int lxc_start(const char *name, char *const argv[], struct lxc_handler *handler,
+int lxc_start(char *const argv[], struct lxc_handler *handler,
              const char *lxcpath, bool daemonize, int *error_num)
 {
        struct start_args start_arg = {
@@ -2060,7 +2060,7 @@ int lxc_start(const char *name, char *const argv[], struct lxc_handler *handler,
        };
 
        TRACE("Doing lxc_start");
-       return __lxc_start(name, handler, &start_ops, &start_arg, lxcpath, daemonize, error_num);
+       return __lxc_start(handler, &start_ops, &start_arg, lxcpath, daemonize, error_num);
 }
 
 static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
index f40b4d661eb13b6735a453f9b22be4bf6dc083cb..370ed9f0ace95bbec6a8c442828f99bdcfbcdb86 100644 (file)
@@ -161,9 +161,8 @@ extern void lxc_fini(const char *name, struct lxc_handler *handler);
  */
 extern int lxc_check_inherited(struct lxc_conf *conf, bool closeall,
                               int *fds_to_ignore, size_t len_fds);
-extern int __lxc_start(const char *, struct lxc_handler *,
-                      struct lxc_operations *, void *, const char *, bool,
-                      int *);
+extern int __lxc_start(struct lxc_handler *, struct lxc_operations *, void *,
+                      const char *, bool, int *);
 
 extern int resolve_clone_flags(struct lxc_handler *handler);