]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fix build with --enable-tests
authorDwight Engen <dwight.engen@oracle.com>
Tue, 21 May 2013 17:30:09 +0000 (13:30 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 22 May 2013 01:32:20 +0000 (20:32 -0500)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.h
src/tests/cgpath.c
src/tests/clonetest.c

index bf3168cb926cd468fd6720d16bc0b8437079b63e..22ccb0b72d96506cfde8ad35bfa3f535a7aee4d3 100644 (file)
@@ -103,6 +103,7 @@ struct lxc_container {
         *  then the original backing store's size will be used if possible.  Note this
         *  only applies to the rootfs.  For any other filesystems, the original size
         *  will be duplicated.
+        * @hookargs: additional arguments to pass to the clone hook script
         */
        struct lxc_container *(*clone)(struct lxc_container *c, const char *newname,
                const char *lxcpath, int flags, const char *bdevtype,
index b7f08856336ca21becb03d7701b8a008912aec7c..2497e9ee22b4f99fca519477741fd3fa7bcc506b 100644 (file)
@@ -27,6 +27,7 @@
 #include <errno.h>
 #include "../lxc/cgroup.h"
 #include "../lxc/lxc.h"
+#include "../lxc/commands.h"
 
 #define MYNAME "lxctest1"
 #define MYNAME2 "lxctest2"
@@ -39,6 +40,7 @@ int main()
 {
        struct lxc_container *c = NULL, *c2 = NULL;
        char *path;
+       char *dirpath = NULL;
        int len;
        int ret, retv = -1;
 
@@ -136,7 +138,6 @@ int main()
                goto out;
        }
 
-       const char *dirpath;
        dirpath = lxc_cmd_get_cgroup_path(NULL, c2->name, c2->config_path);
        if (!dirpath) {
                TSTERR("getting second container's cgpath");
index 5644405e96e80aca1e8e1a5ed77074788b60674d..fbeacdf71b58f84682faff3f89a06bc2ad3c04f1 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
                goto out;
        }
 
-       c2 = c->clone(c, MYNAME2, NULL, 0, NULL, NULL, 0);
+       c2 = c->clone(c, MYNAME2, NULL, 0, NULL, NULL, 0, NULL);
        if (!c2) {
                fprintf(stderr, "%d: %s clone returned NULL\n", __LINE__, MYNAME2);
                goto out;
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
                goto out;
        }
 
-       if ((c2 = c->clone(c, "clonetestlvm2", NULL, 0, NULL, NULL, 0)) == NULL) {
+       if ((c2 = c->clone(c, "clonetestlvm2", NULL, 0, NULL, NULL, 0, NULL)) == NULL) {
                fprintf(stderr, "lvm clone failed\n");
                goto out;
        }
@@ -134,7 +134,7 @@ int main(int argc, char *argv[])
                c2 = NULL;
        }
 
-       if ((c2 = c->clone(c, "clonetestlvm3", NULL, LXC_CLONE_SNAPSHOT, NULL, NULL, 0)) == NULL) {
+       if ((c2 = c->clone(c, "clonetestlvm3", NULL, LXC_CLONE_SNAPSHOT, NULL, NULL, 0, NULL)) == NULL) {
                fprintf(stderr, "lvm clone failed\n");
                goto out;
        }
@@ -148,13 +148,13 @@ int main(int argc, char *argv[])
        }
 
        // Now create an overlayfs clone of a dir-backed container
-       if ((c2 = c->clone(c, "clonetest-o1", NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0)) == NULL) {
+       if ((c2 = c->clone(c, "clonetest-o1", NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0, NULL)) == NULL) {
                fprintf(stderr, "overlayfs clone of dir failed\n");
                goto out;
        }
 
        // Now create an overlayfs clone of the overlayfs clone
-       if ((c3 = c2->clone(c2, "clonetest-o2", NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0)) == NULL) {
+       if ((c3 = c2->clone(c2, "clonetest-o2", NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0, NULL)) == NULL) {
                fprintf(stderr, "overlayfs clone of overlayfs failed\n");
                goto out;
        }