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
62aad75f
Unverified
Commit
62aad75f
authored
Jan 08, 2019
by
Stéphane Graber
Committed by
GitHub
Jan 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2755 from brauner/2018-12-16/rootfs_managed
storage: do not destroy pre-existing rootfs
parents
9aed8757
92fa4347
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
lxccontainer.c
src/lxc/lxccontainer.c
+15
-2
No files found.
src/lxc/lxccontainer.c
View file @
62aad75f
...
...
@@ -1796,7 +1796,7 @@ static bool do_lxcapi_create(struct lxc_container *c, const char *t,
int
partial_fd
;
mode_t
mask
;
pid_t
pid
;
bool
ret
=
false
;
bool
ret
=
false
,
rootfs_managed
=
true
;
char
*
tpath
=
NULL
;
if
(
!
c
)
...
...
@@ -1832,6 +1832,9 @@ static bool do_lxcapi_create(struct lxc_container *c, const char *t,
if
(
!
create_container_dir
(
c
))
goto
free_tpath
;
if
(
c
->
lxc_conf
->
rootfs
.
path
)
rootfs_managed
=
false
;
/* If both template and rootfs.path are set, template is setup as
* rootfs.path. The container is already created if we have a config and
* rootfs.path is accessible
...
...
@@ -1938,8 +1941,18 @@ out_unlock:
remove_partial
(
c
,
partial_fd
);
out
:
if
(
!
ret
)
if
(
!
ret
)
{
bool
reset_managed
=
c
->
lxc_conf
->
rootfs
.
managed
;
/*
* Ensure that we don't destroy storage we didn't create
* ourselves.
*/
if
(
!
rootfs_managed
)
c
->
lxc_conf
->
rootfs
.
managed
=
false
;
container_destroy
(
c
,
NULL
);
c
->
lxc_conf
->
rootfs
.
managed
=
reset_managed
;
}
free_tpath
:
free
(
tpath
);
...
...
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