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
0c9a9339
Commit
0c9a9339
authored
Aug 15, 2017
by
Stéphane Graber
Committed by
GitHub
Aug 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1746 from brauner/2017-08-10/further_lxc_2.1_preparations
further lxc 2.1 preparations
parents
065055b6
7451daf8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
12 deletions
+22
-12
confile.c
src/lxc/confile.c
+0
-0
confile.h
src/lxc/confile.h
+16
-6
confile_utils.c
src/lxc/confile_utils.c
+0
-1
lxccontainer.c
src/lxc/lxccontainer.c
+3
-3
storage_utils.c
src/lxc/storage/storage_utils.c
+1
-0
config_jump_table.c
src/tests/config_jump_table.c
+2
-2
No files found.
src/lxc/confile.c
View file @
0c9a9339
This diff is collapsed.
Click to expand it.
src/lxc/confile.h
View file @
0c9a9339
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
*
*
* Authors:
* Authors:
* Daniel Lezcano <daniel.lezcano at free.fr>
* Daniel Lezcano <daniel.lezcano at free.fr>
* Serge Hallyn <serge@hallyn.com>
* Christian Brauner <christian.brauner@ubuntu.com>
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -31,11 +33,13 @@
...
@@ -31,11 +33,13 @@
struct
lxc_conf
;
struct
lxc_conf
;
struct
lxc_list
;
struct
lxc_list
;
typedef
int
(
*
config_set_cb
)(
const
char
*
,
const
char
*
,
struct
lxc_conf
*
,
typedef
int
(
*
config_set_cb
)(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
conf
,
void
*
data
);
typedef
int
(
*
config_get_cb
)(
const
char
*
key
,
char
*
value
,
int
inlen
,
struct
lxc_conf
*
conf
,
void
*
data
);
typedef
int
(
*
config_clr_cb
)(
const
char
*
key
,
struct
lxc_conf
*
conf
,
void
*
data
);
void
*
data
);
typedef
int
(
*
config_get_cb
)(
const
char
*
,
char
*
,
int
,
struct
lxc_conf
*
,
void
*
);
typedef
int
(
*
config_clr_cb
)(
const
char
*
,
struct
lxc_conf
*
c
,
void
*
data
);
struct
lxc_config_t
{
struct
lxc_config_t
{
char
*
name
;
char
*
name
;
config_set_cb
set
;
config_set_cb
set
;
...
@@ -44,8 +48,14 @@ struct lxc_config_t {
...
@@ -44,8 +48,14 @@ 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_listconfigs
(
char
*
retv
,
int
inlen
);
/* List all configuration items associated with a given network. For example
* pass "lxc.net.[i]" to retrieve all configuration items associated with
* the network associated with index [i].
*/
extern
int
lxc_list_net
(
struct
lxc_conf
*
c
,
const
char
*
key
,
char
*
retv
,
int
inlen
);
extern
int
lxc_list_config_items
(
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/confile_utils.c
View file @
0c9a9339
...
@@ -680,4 +680,3 @@ bool parse_limit_value(const char **value, unsigned long *res)
...
@@ -680,4 +680,3 @@ bool parse_limit_value(const char **value, unsigned long *res)
return
true
;
return
true
;
}
}
src/lxc/lxccontainer.c
View file @
0c9a9339
...
@@ -2249,7 +2249,7 @@ WRAP_API_1(char *, lxcapi_get_running_config_item, const char *)
...
@@ -2249,7 +2249,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.net.<idx>', i.e. 'lxc.net.0'
* Support 'lxc.net.<idx>', i.e. 'lxc.net.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
...
@@ -2260,8 +2260,8 @@ static int do_lxcapi_get_keys(struct lxc_container *c, const char *key, char *re
...
@@ -2260,8 +2260,8 @@ static int do_lxcapi_get_keys(struct lxc_container *c, const char *key, char *re
if
(
container_mem_lock
(
c
))
if
(
container_mem_lock
(
c
))
return
-
1
;
return
-
1
;
int
ret
=
-
1
;
int
ret
=
-
1
;
if
(
strncmp
(
key
,
"lxc.net."
,
8
)
==
0
)
if
(
!
strncmp
(
key
,
"lxc.net."
,
8
)
)
ret
=
lxc_list_n
icconfigs
(
c
->
lxc_conf
,
key
,
retv
,
inlen
);
ret
=
lxc_list_n
et
(
c
->
lxc_conf
,
key
,
retv
,
inlen
);
else
if
(
strncmp
(
key
,
"lxc.network."
,
12
)
==
0
)
else
if
(
strncmp
(
key
,
"lxc.network."
,
12
)
==
0
)
ret
=
lxc_list_nicconfigs_legacy
(
c
->
lxc_conf
,
key
,
retv
,
inlen
);
ret
=
lxc_list_nicconfigs_legacy
(
c
->
lxc_conf
,
key
,
retv
,
inlen
);
container_mem_unlock
(
c
);
container_mem_unlock
(
c
);
...
...
src/lxc/storage/storage_utils.c
View file @
0c9a9339
...
@@ -445,6 +445,7 @@ bool is_valid_storage_type(const char *type)
...
@@ -445,6 +445,7 @@ bool is_valid_storage_type(const char *type)
strcmp
(
type
,
"loop"
)
==
0
||
strcmp
(
type
,
"loop"
)
==
0
||
strcmp
(
type
,
"lvm"
)
==
0
||
strcmp
(
type
,
"lvm"
)
==
0
||
strcmp
(
type
,
"nbd"
)
==
0
||
strcmp
(
type
,
"nbd"
)
==
0
||
strcmp
(
type
,
"overlay"
)
==
0
||
strcmp
(
type
,
"overlayfs"
)
==
0
||
strcmp
(
type
,
"overlayfs"
)
==
0
||
strcmp
(
type
,
"rbd"
)
==
0
||
strcmp
(
type
,
"rbd"
)
==
0
||
strcmp
(
type
,
"zfs"
)
==
0
)
strcmp
(
type
,
"zfs"
)
==
0
)
...
...
src/tests/config_jump_table.c
View file @
0c9a9339
...
@@ -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