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
2a902a63
Commit
2a902a63
authored
May 03, 2017
by
Stéphane Graber
Committed by
GitHub
May 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1535 from brauner/2017-05-03/api_extension_lxc_is_supported_config_item
api extension: lxc_config_item_is_supported()
parents
2c0807c7
add40e62
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
lxccontainer.c
src/lxc/lxccontainer.c
+5
-0
lxccontainer.h
src/lxc/lxccontainer.h
+7
-0
get_item.c
src/tests/get_item.c
+11
-0
No files found.
src/lxc/lxccontainer.c
View file @
2a902a63
...
...
@@ -4522,3 +4522,8 @@ free_ct_name:
free
(
ct_name
);
return
ret
;
}
bool
lxc_config_item_is_supported
(
const
char
*
key
)
{
return
!!
lxc_getconfig
(
key
);
}
src/lxc/lxccontainer.h
View file @
2a902a63
...
...
@@ -1022,6 +1022,13 @@ int list_all_containers(const char *lxcpath, char ***names, struct lxc_container
*/
void
lxc_log_close
(
void
);
/*!
* \brief Check if the configuration item is supported by this LXC instance.
*
* \param key Configuration item to check for.
*/
bool
lxc_config_item_is_supported
(
const
char
*
key
);
#ifdef __cplusplus
}
#endif
...
...
src/tests/get_item.c
View file @
2a902a63
...
...
@@ -391,6 +391,17 @@ int main(int argc, char *argv[])
fprintf
(
stderr
,
"%d: failed clearing lxc.hook
\n
"
,
__LINE__
);
goto
out
;
}
if
(
!
lxc_config_item_is_supported
(
"lxc.arch"
))
{
fprintf
(
stderr
,
"%d: failed to report
\"
lxc.arch
\"
as supported configuration item
\n
"
,
__LINE__
);
goto
out
;
}
if
(
lxc_config_item_is_supported
(
"lxc.nonsense"
))
{
fprintf
(
stderr
,
"%d: failed to detect
\"
lxc.nonsense
\"
as unsupported configuration item
\n
"
,
__LINE__
);
goto
out
;
}
printf
(
"All get_item tests passed
\n
"
);
ret
=
EXIT_SUCCESS
;
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