]> git.proxmox.com Git - mirror_lxc.git/commitdiff
concurrent: take lxc template to use as argument
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Sat, 14 Sep 2013 17:54:46 +0000 (12:54 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Sat, 14 Sep 2013 17:54:46 +0000 (12:54 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/tests/concurrent.c

index 7faf34cb655c744fb92fb4811a48cf3767dfacc7..7cf86c4591d5545fce3ff1f28845327f3c2369e7 100644 (file)
@@ -22,6 +22,8 @@
 
 #define NTHREADS 5
 
+char *template = "busybox";
+
 struct thread_args {
     int thread_id;
     int return_code;
@@ -40,7 +42,7 @@ void * concurrent(void *arguments) {
     args->return_code = 1;
     if (strcmp(args->mode, "create") == 0) {
         if (!c->is_defined(c)) {
-            if (!c->create(c, "busybox", NULL, NULL, 1, NULL)) {
+            if (!c->create(c, template, NULL, NULL, 1, NULL)) {
                 fprintf(stderr, "Creating the container (%s) failed...\n", name);
                 goto out;
             }
@@ -91,6 +93,9 @@ int main(int argc, char *argv[]) {
 
     char *modes[] = {"create", "start", "stop", "destroy", NULL};
 
+    if (argc > 1)
+           template = argv[1];
+
     pthread_attr_init(&attr);
     pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);