Skip to content

Commit

Permalink
concurrent: take lxc template to use as argument
Browse files Browse the repository at this point in the history
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
hallyn committed Sep 14, 2013
1 parent 84bce17 commit 103a2fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tests/concurrent.c
Expand Up @@ -22,6 +22,8 @@

#define NTHREADS 5

char *template = "busybox";

struct thread_args {
int thread_id;
int return_code;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 103a2fc

Please sign in to comment.