diff options
author | Daniel Lezcano <daniel.lezcano@free.fr> | 2010-12-17 11:43:37 +0100 |
---|---|---|
committer | Daniel Lezcano <dlezcano@fr.ibm.com> | 2010-12-17 11:43:37 +0100 |
commit | b234e44fdfb03ebb29f9bcb121d83e25b5a49800 (patch) | |
tree | cec1a8fdcff172e809104547b3ab6db29ae57da6 | |
parent | Remove unused nscgroup field (diff) | |
download | lxc-b234e44fdfb03ebb29f9bcb121d83e25b5a49800.tar.gz lxc-b234e44fdfb03ebb29f9bcb121d83e25b5a49800.tar.bz2 lxc-b234e44fdfb03ebb29f9bcb121d83e25b5a49800.zip |
Change nscgroup interface
Prepare the nscgroup to be converted to the clone_children changes.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
-rw-r--r-- | src/lxc/cgroup.c | 4 | ||||
-rw-r--r-- | src/lxc/cgroup.h | 2 | ||||
-rw-r--r-- | src/lxc/start.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 96a8ecd..350d439 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -85,7 +85,7 @@ out: return err; } -int lxc_rename_nsgroup(const char *name, struct lxc_handler *handler) +int lxc_rename_nsgroup(const char *name, pid_t pid) { char oldname[MAXPATHLEN]; char newname[MAXPATHLEN]; @@ -97,7 +97,7 @@ int lxc_rename_nsgroup(const char *name, struct lxc_handler *handler) return -1; } - snprintf(oldname, MAXPATHLEN, "%s/%d", cgroup, handler->pid); + snprintf(oldname, MAXPATHLEN, "%s/%d", cgroup, pid); snprintf(newname, MAXPATHLEN, "%s/%s", cgroup, name); /* there is a previous cgroup, assume it is empty, otherwise diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h index 640f1d2..905686e 100644 --- a/src/lxc/cgroup.h +++ b/src/lxc/cgroup.h @@ -26,7 +26,7 @@ #define MAXPRIOLEN 24 struct lxc_handler; -int lxc_rename_nsgroup(const char *name, struct lxc_handler *handler); +int lxc_rename_nsgroup(const char *name, pid_t pid); int lxc_unlink_nsgroup(const char *name); int lxc_cgroup_path_get(char **path, const char *name); int lxc_cgroup_nrtasks(const char *name); diff --git a/src/lxc/start.c b/src/lxc/start.c index 451d355..7e17cc5 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -506,7 +506,7 @@ int lxc_spawn(struct lxc_handler *handler) if (lxc_sync_wait_child(handler, LXC_SYNC_CONFIGURE)) failed_before_rename = 1; - if (lxc_rename_nsgroup(name, handler)) + if (lxc_rename_nsgroup(name, handler->pid)) goto out_delete_net; if (failed_before_rename) |