From 7bdf97d26be920a6e0503cd4caf5c1ae9cbd157d Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sun, 15 Mar 2020 15:45:54 +0100 Subject: [PATCH] {_}lxc_start: remove "name" argument as it's directly available in the handler itself. Signed-off-by: Christian Brauner --- src/lxc/execute.c | 2 +- src/lxc/lxc.h | 6 ++---- src/lxc/lxccontainer.c | 4 ++-- src/lxc/start.c | 10 +++++----- src/lxc/start.h | 5 ++--- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/lxc/execute.c b/src/lxc/execute.c index 1cff0eda1..7dd835862 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -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); } diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index a58ca5f1b..630eff0b4 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -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 diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 06a1eb9b6..55eaf50b3 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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"); diff --git a/src/lxc/start.c b/src/lxc/start.c index d33fd4e34..08f336cf0 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -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, diff --git a/src/lxc/start.h b/src/lxc/start.h index f40b4d661..370ed9f0a 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -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); -- 2.39.5