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
48dea346
Unverified
Commit
48dea346
authored
Aug 11, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Aug 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: lxc_listconfigs -> lxc_list_config_items
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
5a199088
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
confile.c
src/lxc/confile.c
+21
-21
confile.h
src/lxc/confile.h
+1
-1
lxccontainer.c
src/lxc/lxccontainer.c
+1
-1
config_jump_table.c
src/tests/config_jump_table.c
+2
-2
No files found.
src/lxc/confile.c
View file @
48dea346
...
@@ -491,27 +491,6 @@ extern struct lxc_config_t *lxc_getconfig(const char *key)
...
@@ -491,27 +491,6 @@ extern struct lxc_config_t *lxc_getconfig(const char *key)
} \
} \
} while (0);
} while (0);
int
lxc_listconfigs
(
char
*
retv
,
int
inlen
)
{
size_t
i
;
int
len
;
int
fulllen
=
0
;
if
(
!
retv
)
inlen
=
0
;
else
memset
(
retv
,
0
,
inlen
);
for
(
i
=
0
;
i
<
config_size
;
i
++
)
{
char
*
s
=
config
[
i
].
name
;
if
(
s
[
strlen
(
s
)
-
1
]
==
'.'
)
continue
;
strprint
(
retv
,
inlen
,
"%s
\n
"
,
s
);
}
return
fulllen
;
}
static
int
set_config_string_item
(
char
**
conf_item
,
const
char
*
value
)
static
int
set_config_string_item
(
char
**
conf_item
,
const
char
*
value
)
{
{
char
*
new_value
;
char
*
new_value
;
...
@@ -3930,3 +3909,24 @@ static int get_config_includefiles(const char *key, char *retv, int inlen,
...
@@ -3930,3 +3909,24 @@ static int get_config_includefiles(const char *key, char *retv, int inlen,
{
{
return
-
ENOSYS
;
return
-
ENOSYS
;
}
}
int
lxc_list_config_items
(
char
*
retv
,
int
inlen
)
{
size_t
i
;
int
len
;
int
fulllen
=
0
;
if
(
!
retv
)
inlen
=
0
;
else
memset
(
retv
,
0
,
inlen
);
for
(
i
=
0
;
i
<
config_size
;
i
++
)
{
char
*
s
=
config
[
i
].
name
;
if
(
s
[
strlen
(
s
)
-
1
]
==
'.'
)
continue
;
strprint
(
retv
,
inlen
,
"%s
\n
"
,
s
);
}
return
fulllen
;
}
src/lxc/confile.h
View file @
48dea346
...
@@ -47,7 +47,7 @@ struct lxc_config_t {
...
@@ -47,7 +47,7 @@ struct lxc_config_t {
extern
struct
lxc_config_t
*
lxc_getconfig
(
const
char
*
key
);
extern
struct
lxc_config_t
*
lxc_getconfig
(
const
char
*
key
);
extern
int
lxc_list_nicconfigs
(
struct
lxc_conf
*
c
,
const
char
*
key
,
char
*
retv
,
int
inlen
);
extern
int
lxc_list_nicconfigs
(
struct
lxc_conf
*
c
,
const
char
*
key
,
char
*
retv
,
int
inlen
);
extern
int
lxc_list
config
s
(
char
*
retv
,
int
inlen
);
extern
int
lxc_list
_config_item
s
(
char
*
retv
,
int
inlen
);
extern
int
lxc_config_read
(
const
char
*
file
,
struct
lxc_conf
*
conf
,
bool
from_include
);
extern
int
lxc_config_read
(
const
char
*
file
,
struct
lxc_conf
*
conf
,
bool
from_include
);
extern
int
append_unexp_config_line
(
const
char
*
line
,
struct
lxc_conf
*
conf
);
extern
int
append_unexp_config_line
(
const
char
*
line
,
struct
lxc_conf
*
conf
);
...
...
src/lxc/lxccontainer.c
View file @
48dea346
...
@@ -2193,7 +2193,7 @@ WRAP_API_1(char *, lxcapi_get_running_config_item, const char *)
...
@@ -2193,7 +2193,7 @@ WRAP_API_1(char *, lxcapi_get_running_config_item, const char *)
static
int
do_lxcapi_get_keys
(
struct
lxc_container
*
c
,
const
char
*
key
,
char
*
retv
,
int
inlen
)
static
int
do_lxcapi_get_keys
(
struct
lxc_container
*
c
,
const
char
*
key
,
char
*
retv
,
int
inlen
)
{
{
if
(
!
key
)
if
(
!
key
)
return
lxc_list
config
s
(
retv
,
inlen
);
return
lxc_list
_config_item
s
(
retv
,
inlen
);
/*
/*
* Support 'lxc.network.<idx>', i.e. 'lxc.network.0'
* Support 'lxc.network.<idx>', i.e. 'lxc.network.0'
* This is an intelligent result to show which keys are valid given
* This is an intelligent result to show which keys are valid given
...
...
src/tests/config_jump_table.c
View file @
48dea346
...
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
...
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
int
fulllen
=
0
,
inlen
=
0
,
ret
=
EXIT_FAILURE
;
int
fulllen
=
0
,
inlen
=
0
,
ret
=
EXIT_FAILURE
;
char
*
key
,
*
keys
,
*
saveptr
=
NULL
;
char
*
key
,
*
keys
,
*
saveptr
=
NULL
;
fulllen
=
lxc_list
config
s
(
NULL
,
inlen
);
fulllen
=
lxc_list
_config_item
s
(
NULL
,
inlen
);
keys
=
malloc
(
sizeof
(
char
)
*
fulllen
+
1
);
keys
=
malloc
(
sizeof
(
char
)
*
fulllen
+
1
);
if
(
!
keys
)
{
if
(
!
keys
)
{
...
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
...
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
exit
(
ret
);
exit
(
ret
);
}
}
if
(
lxc_list
config
s
(
keys
,
fulllen
)
!=
fulllen
)
{
if
(
lxc_list
_config_item
s
(
keys
,
fulllen
)
!=
fulllen
)
{
lxc_error
(
"%s
\n
"
,
"failed to retrieve configuration keys"
);
lxc_error
(
"%s
\n
"
,
"failed to retrieve configuration keys"
);
goto
on_error
;
goto
on_error
;
}
}
...
...
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