Changeset 612
- Timestamp:
- 05/19/07 17:56:18 (2 years ago)
- Files:
-
- trunk/src/vcc/vcc/login.c (modified) (3 diffs)
- trunk/src/vshelper/main.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/vcc/vcc/login.c
r586 r612 22 22 #include <lucid/chroot.h> 23 23 #include <lucid/log.h> 24 #include <lucid/misc.h> 25 #include <lucid/open.h> 26 #include <lucid/printf.h> 24 27 25 28 #include "vcc.h" … … 29 32 { 30 33 xmlrpc_value *result; 34 char *name, *vdir, *cpusetpath; 35 char *av[] = { "/bin/sh", NULL }; 36 int cpusetfd; 31 37 xid_t xid; 32 char *name, *vdir;33 char *av[] = { "/bin/sh", NULL };34 38 35 39 if (argc < 1) … … 58 62 xmlrpc_DECREF(result); 59 63 64 /* Add the PID of the current process to the cpuset for this 65 * vserver, if the cpuset exists, and then fork. */ 66 asprintf(&cpusetpath, "/dev/cpuset/xid%d/tasks", xid); 67 68 if (ispath(cpusetpath)) { 69 if ((cpusetfd = open_append(cpusetpath)) == -1) { 70 log_perror_and_die("open_append(%s)", cpusetpath); 71 } 72 73 else { 74 dprintf(cpusetfd, "%d", getpid()); 75 close(cpusetfd); 76 } 77 } 78 60 79 if (ns_enter(xid, 0) == -1) 61 80 log_perror_and_die("ns_enter"); trunk/src/vshelper/main.c
r598 r612 28 28 #include <lucid/exec.h> 29 29 #include <lucid/log.h> 30 #include <lucid/misc.h> 30 31 #include <lucid/open.h> 31 32 #include <lucid/printf.h> … … 160 161 xmlrpc_value *response; 161 162 char *vdir, *init; 162 int i; 163 char *fastboot, *cpusetpath; 164 int i, cpusetfd; 163 165 164 166 vx_flags_t migrate_flags = { … … 179 181 log_and_return_if_fault(env); 180 182 181 char *fastboot = str_path_concat(vdir, "/fastboot"); 183 /* Write fastboot file to vdir for some distros */ 184 fastboot = str_path_concat(vdir, "/fastboot"); 182 185 close(open_trunc(fastboot)); 186 187 /* Add the PID of the current process to the cpuset for this 188 * vserver, if the cpuset exists, and then fork. */ 189 asprintf(&cpusetpath, "/dev/cpuset/xid%d/tasks", xid); 190 191 if (ispath(cpusetpath)) { 192 if ((cpusetfd = open_append(cpusetpath)) == -1) { 193 log_perror("open_append(%s)", cpusetpath); 194 } 195 196 else { 197 dprintf(cpusetfd, "%d", getpid()); 198 close(cpusetfd); 199 } 200 } 183 201 184 202 switch (fork()) {
