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
d8cf0289
Unverified
Commit
d8cf0289
authored
Dec 08, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: cleanup set_config_rootfs_path()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
c1b2319b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
confile.c
src/lxc/confile.c
+6
-10
No files found.
src/lxc/confile.c
View file @
d8cf0289
...
@@ -2540,8 +2540,9 @@ static int set_config_includefiles(const char *key, const char *value,
...
@@ -2540,8 +2540,9 @@ static int set_config_includefiles(const char *key, const char *value,
static
int
set_config_rootfs_path
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_rootfs_path
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
__do_free
char
*
dup
=
NULL
;
int
ret
;
int
ret
;
char
*
dup
,
*
tmp
;
char
*
tmp
;
const
char
*
container_path
;
const
char
*
container_path
;
if
(
lxc_config_value_empty
(
value
))
{
if
(
lxc_config_value_empty
(
value
))
{
...
@@ -2552,7 +2553,7 @@ static int set_config_rootfs_path(const char *key, const char *value,
...
@@ -2552,7 +2553,7 @@ static int set_config_rootfs_path(const char *key, const char *value,
dup
=
strdup
(
value
);
dup
=
strdup
(
value
);
if
(
!
dup
)
if
(
!
dup
)
return
-
1
;
return
ret_errno
(
ENOMEM
)
;
/* Split <storage type>:<container path> into <storage type> and
/* Split <storage type>:<container path> into <storage type> and
* <container path>. Set "rootfs.bdev_type" to <storage type> and
* <container path>. Set "rootfs.bdev_type" to <storage type> and
...
@@ -2563,10 +2564,8 @@ static int set_config_rootfs_path(const char *key, const char *value,
...
@@ -2563,10 +2564,8 @@ static int set_config_rootfs_path(const char *key, const char *value,
*
tmp
=
'\0'
;
*
tmp
=
'\0'
;
ret
=
set_config_path_item
(
&
lxc_conf
->
rootfs
.
bdev_type
,
dup
);
ret
=
set_config_path_item
(
&
lxc_conf
->
rootfs
.
bdev_type
,
dup
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
free
(
dup
);
return
ret_errno
(
ENOMEM
);
return
-
1
;
}
tmp
++
;
tmp
++
;
container_path
=
tmp
;
container_path
=
tmp
;
...
@@ -2574,10 +2573,7 @@ static int set_config_rootfs_path(const char *key, const char *value,
...
@@ -2574,10 +2573,7 @@ static int set_config_rootfs_path(const char *key, const char *value,
container_path
=
value
;
container_path
=
value
;
}
}
ret
=
set_config_path_item
(
&
lxc_conf
->
rootfs
.
path
,
container_path
);
return
set_config_path_item
(
&
lxc_conf
->
rootfs
.
path
,
container_path
);
free
(
dup
);
return
ret
;
}
}
static
int
set_config_rootfs_managed
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_rootfs_managed
(
const
char
*
key
,
const
char
*
value
,
...
...
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