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
d37f7cd7
Unverified
Commit
d37f7cd7
authored
May 31, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: extend call back system
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
72be9ed7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
confile.c
src/lxc/confile.c
+2
-2
confile.h
src/lxc/confile.h
+3
-1
lxccontainer.c
src/lxc/lxccontainer.c
+1
-1
No files found.
src/lxc/confile.c
View file @
d37f7cd7
...
...
@@ -407,7 +407,7 @@ static int config_network_nic(const char *key, const char *value,
ERROR
(
"unknown key %s"
,
key
);
goto
out
;
}
ret
=
config
->
cb
(
key
,
value
,
lxc_conf
);
ret
=
config
->
set
(
key
,
value
,
lxc_conf
);
out:
free
(
copy
);
...
...
@@ -2418,7 +2418,7 @@ static int parse_line(char *buffer, void *data)
goto
out
;
}
ret
=
config
->
cb
(
key
,
value
,
plc
->
conf
);
ret
=
config
->
set
(
key
,
value
,
plc
->
conf
);
out:
free
(
linep
);
...
...
src/lxc/confile.h
View file @
d37f7cd7
...
...
@@ -34,7 +34,9 @@ struct lxc_list;
typedef
int
(
*
config_cb
)(
const
char
*
,
const
char
*
,
struct
lxc_conf
*
);
struct
lxc_config_t
{
char
*
name
;
config_cb
cb
;
config_cb
set
;
config_cb
get
;
config_cb
clear
;
};
extern
struct
lxc_config_t
*
lxc_getconfig
(
const
char
*
key
);
...
...
src/lxc/lxccontainer.c
View file @
d37f7cd7
...
...
@@ -2461,7 +2461,7 @@ static bool set_config_item_locked(struct lxc_container *c, const char *key, con
config
=
lxc_getconfig
(
key
);
if
(
!
config
)
return
false
;
if
(
config
->
cb
(
key
,
v
,
c
->
lxc_conf
)
!=
0
)
if
(
config
->
set
(
key
,
v
,
c
->
lxc_conf
)
!=
0
)
return
false
;
return
do_append_unexp_config_line
(
c
->
lxc_conf
,
key
,
v
);
}
...
...
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