Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
481624b3
Commit
481624b3
authored
May 21, 2013
by
Dwight Engen
Committed by
Serge Hallyn
May 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build with --enable-tests
Signed-off-by:
Dwight Engen
<
dwight.engen@oracle.com
>
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
fa9ac567
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
lxccontainer.h
src/lxc/lxccontainer.h
+1
-0
cgpath.c
src/tests/cgpath.c
+2
-1
clonetest.c
src/tests/clonetest.c
+5
-5
No files found.
src/lxc/lxccontainer.h
View file @
481624b3
...
@@ -103,6 +103,7 @@ struct lxc_container {
...
@@ -103,6 +103,7 @@ struct lxc_container {
* then the original backing store's size will be used if possible. Note this
* 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
* only applies to the rootfs. For any other filesystems, the original size
* will be duplicated.
* will be duplicated.
* @hookargs: additional arguments to pass to the clone hook script
*/
*/
struct
lxc_container
*
(
*
clone
)(
struct
lxc_container
*
c
,
const
char
*
newname
,
struct
lxc_container
*
(
*
clone
)(
struct
lxc_container
*
c
,
const
char
*
newname
,
const
char
*
lxcpath
,
int
flags
,
const
char
*
bdevtype
,
const
char
*
lxcpath
,
int
flags
,
const
char
*
bdevtype
,
...
...
src/tests/cgpath.c
View file @
481624b3
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <errno.h>
#include <errno.h>
#include "../lxc/cgroup.h"
#include "../lxc/cgroup.h"
#include "../lxc/lxc.h"
#include "../lxc/lxc.h"
#include "../lxc/commands.h"
#define MYNAME "lxctest1"
#define MYNAME "lxctest1"
#define MYNAME2 "lxctest2"
#define MYNAME2 "lxctest2"
...
@@ -39,6 +40,7 @@ int main()
...
@@ -39,6 +40,7 @@ int main()
{
{
struct
lxc_container
*
c
=
NULL
,
*
c2
=
NULL
;
struct
lxc_container
*
c
=
NULL
,
*
c2
=
NULL
;
char
*
path
;
char
*
path
;
char
*
dirpath
=
NULL
;
int
len
;
int
len
;
int
ret
,
retv
=
-
1
;
int
ret
,
retv
=
-
1
;
...
@@ -136,7 +138,6 @@ int main()
...
@@ -136,7 +138,6 @@ int main()
goto
out
;
goto
out
;
}
}
const
char
*
dirpath
;
dirpath
=
lxc_cmd_get_cgroup_path
(
NULL
,
c2
->
name
,
c2
->
config_path
);
dirpath
=
lxc_cmd_get_cgroup_path
(
NULL
,
c2
->
name
,
c2
->
config_path
);
if
(
!
dirpath
)
{
if
(
!
dirpath
)
{
TSTERR
(
"getting second container's cgpath"
);
TSTERR
(
"getting second container's cgpath"
);
...
...
src/tests/clonetest.c
View file @
481624b3
...
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
...
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
goto
out
;
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
)
{
if
(
!
c2
)
{
fprintf
(
stderr
,
"%d: %s clone returned NULL
\n
"
,
__LINE__
,
MYNAME2
);
fprintf
(
stderr
,
"%d: %s clone returned NULL
\n
"
,
__LINE__
,
MYNAME2
);
goto
out
;
goto
out
;
...
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
...
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
goto
out
;
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
"
);
fprintf
(
stderr
,
"lvm clone failed
\n
"
);
goto
out
;
goto
out
;
}
}
...
@@ -134,7 +134,7 @@ int main(int argc, char *argv[])
...
@@ -134,7 +134,7 @@ int main(int argc, char *argv[])
c2
=
NULL
;
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
"
);
fprintf
(
stderr
,
"lvm clone failed
\n
"
);
goto
out
;
goto
out
;
}
}
...
@@ -148,13 +148,13 @@ int main(int argc, char *argv[])
...
@@ -148,13 +148,13 @@ int main(int argc, char *argv[])
}
}
// Now create an overlayfs clone of a dir-backed container
// 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
"
);
fprintf
(
stderr
,
"overlayfs clone of dir failed
\n
"
);
goto
out
;
goto
out
;
}
}
// Now create an overlayfs clone of the overlayfs clone
// 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
"
);
fprintf
(
stderr
,
"overlayfs clone of overlayfs failed
\n
"
);
goto
out
;
goto
out
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment