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
bd08898f
Commit
bd08898f
authored
Apr 05, 2016
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #945 from brauner/bugfix_branch
set lxc.rootfs.backend on container creation
parents
a3ff5b56
8869eb5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
lxccontainer.c
src/lxc/lxccontainer.c
+10
-13
No files found.
src/lxc/lxccontainer.c
View file @
bd08898f
...
...
@@ -1037,6 +1037,7 @@ static struct bdev *do_bdev_create(struct lxc_container *c, const char *type,
}
do_lxcapi_set_config_item
(
c
,
"lxc.rootfs"
,
bdev
->
src
);
do_lxcapi_set_config_item
(
c
,
"lxc.rootfs.backend"
,
bdev
->
type
);
/* if we are not root, chown the rootfs dir to root in the
* target uidmap */
...
...
@@ -1076,7 +1077,7 @@ static bool create_run_template(struct lxc_container *c, char *tpath, bool need_
}
if
(
pid
==
0
)
{
// child
char
*
patharg
,
*
namearg
,
*
rootfsarg
,
*
src
;
char
*
patharg
,
*
namearg
,
*
rootfsarg
;
struct
bdev
*
bdev
=
NULL
;
int
i
;
int
ret
,
len
,
nargs
=
0
;
...
...
@@ -1087,18 +1088,7 @@ static bool create_run_template(struct lxc_container *c, char *tpath, bool need_
exit
(
1
);
}
src
=
c
->
lxc_conf
->
rootfs
.
path
;
/*
* for an overlay create, what the user wants is the template to fill
* in what will become the readonly lower layer. So don't mount for
* the template
*/
if
(
strncmp
(
src
,
"overlayfs:"
,
10
)
==
0
)
src
=
ovl_getlower
(
src
+
10
);
if
(
strncmp
(
src
,
"aufs:"
,
5
)
==
0
)
src
=
ovl_getlower
(
src
+
5
);
bdev
=
bdev_init
(
c
->
lxc_conf
,
src
,
c
->
lxc_conf
->
rootfs
.
mount
,
NULL
);
bdev
=
bdev_init
(
c
->
lxc_conf
,
c
->
lxc_conf
->
rootfs
.
path
,
c
->
lxc_conf
->
rootfs
.
mount
,
NULL
);
if
(
!
bdev
)
{
ERROR
(
"Error opening rootfs"
);
exit
(
1
);
...
...
@@ -2855,6 +2845,8 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
}
free
(
c
->
lxc_conf
->
rootfs
.
path
);
c
->
lxc_conf
->
rootfs
.
path
=
strdup
(
bdev
->
src
);
free
(
c
->
lxc_conf
->
rootfs
.
bdev_type
);
c
->
lxc_conf
->
rootfs
.
bdev_type
=
strdup
(
bdev
->
type
);
bdev_put
(
bdev
);
if
(
!
c
->
lxc_conf
->
rootfs
.
path
)
{
ERROR
(
"Out of memory while setting storage path"
);
...
...
@@ -2866,6 +2858,11 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
ERROR
(
"Error saving new rootfs to cloned config"
);
return
-
1
;
}
clear_unexp_config_line
(
c
->
lxc_conf
,
"lxc.rootfs.backend"
,
false
);
if
(
!
do_append_unexp_config_line
(
c
->
lxc_conf
,
"lxc.rootfs.backend"
,
c
->
lxc_conf
->
rootfs
.
bdev_type
))
{
ERROR
(
"Error saving new rootfs to cloned config"
);
return
-
1
;
}
if
(
flags
&
LXC_CLONE_SNAPSHOT
)
copy_rdepends
(
c
,
c0
);
if
(
need_rdep
)
{
...
...
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