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
3aed4934
Unverified
Commit
3aed4934
authored
Jul 02, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: lxc.console --> lxc.console.path
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
7a96a068
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
13 deletions
+27
-13
lxc.container.conf.sgml.in
doc/lxc.container.conf.sgml.in
+2
-2
confile.c
src/lxc/confile.c
+10
-5
criu.c
src/lxc/criu.c
+4
-4
lxc-test-checkpoint-restore
src/tests/lxc-test-checkpoint-restore
+1
-1
parse_config_file.c
src/tests/parse_config_file.c
+10
-1
No files found.
doc/lxc.container.conf.sgml.in
View file @
3aed4934
...
@@ -685,7 +685,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
...
@@ -685,7 +685,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.console</option>
<option>lxc.console
.path
</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
...
@@ -1619,7 +1619,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
...
@@ -1619,7 +1619,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<listitem>
<listitem>
<para>
<para>
The path to the console output of the container if not NULL.
The path to the console output of the container if not NULL.
[<option>-c</option>] [<option>lxc.console</option>]
[<option>-c</option>] [<option>lxc.console
.path
</option>]
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
...
src/lxc/confile.c
View file @
3aed4934
...
@@ -114,7 +114,7 @@ lxc_config_define(net);
...
@@ -114,7 +114,7 @@ lxc_config_define(net);
lxc_config_define
(
cap_drop
);
lxc_config_define
(
cap_drop
);
lxc_config_define
(
cap_keep
);
lxc_config_define
(
cap_keep
);
lxc_config_define
(
console_logfile
);
lxc_config_define
(
console_logfile
);
lxc_config_define
(
console
);
lxc_config_define
(
console
_path
);
lxc_config_define
(
seccomp
);
lxc_config_define
(
seccomp
);
lxc_config_define
(
includefiles
);
lxc_config_define
(
includefiles
);
lxc_config_define
(
autodev
);
lxc_config_define
(
autodev
);
...
@@ -232,12 +232,17 @@ static struct lxc_config_t config[] = {
...
@@ -232,12 +232,17 @@ static struct lxc_config_t config[] = {
{
"lxc.cap.drop"
,
set_config_cap_drop
,
get_config_cap_drop
,
clr_config_cap_drop
,
},
{
"lxc.cap.drop"
,
set_config_cap_drop
,
get_config_cap_drop
,
clr_config_cap_drop
,
},
{
"lxc.cap.keep"
,
set_config_cap_keep
,
get_config_cap_keep
,
clr_config_cap_keep
,
},
{
"lxc.cap.keep"
,
set_config_cap_keep
,
get_config_cap_keep
,
clr_config_cap_keep
,
},
{
"lxc.console.logfile"
,
set_config_console_logfile
,
get_config_console_logfile
,
clr_config_console_logfile
,
},
{
"lxc.console.logfile"
,
set_config_console_logfile
,
get_config_console_logfile
,
clr_config_console_logfile
,
},
{
"lxc.console
"
,
set_config_console
,
get_config_console
,
clr_config_console
,
},
{
"lxc.console
.path"
,
set_config_console_path
,
get_config_console_path
,
clr_config_console_path
,
},
{
"lxc.seccomp"
,
set_config_seccomp
,
get_config_seccomp
,
clr_config_seccomp
,
},
{
"lxc.seccomp"
,
set_config_seccomp
,
get_config_seccomp
,
clr_config_seccomp
,
},
{
"lxc.include"
,
set_config_includefiles
,
get_config_includefiles
,
clr_config_includefiles
,
},
{
"lxc.include"
,
set_config_includefiles
,
get_config_includefiles
,
clr_config_includefiles
,
},
{
"lxc.autodev"
,
set_config_autodev
,
get_config_autodev
,
clr_config_autodev
,
},
{
"lxc.autodev"
,
set_config_autodev
,
get_config_autodev
,
clr_config_autodev
,
},
/* REMOVE IN LXC 3.0
/* REMOVE IN LXC 3.0
legacy console key
*/
{
"lxc.console"
,
set_config_console_path
,
get_config_console_path
,
clr_config_console_path
,
},
/* REMOVE IN LXC 3.0
legacy singal keys
legacy singal keys
*/
*/
{
"lxc.haltsignal"
,
set_config_signal_halt
,
get_config_signal_halt
,
clr_config_signal_halt
,
},
{
"lxc.haltsignal"
,
set_config_signal_halt
,
get_config_signal_halt
,
clr_config_signal_halt
,
},
...
@@ -1936,7 +1941,7 @@ static int set_config_cap_drop(const char *key, const char *value,
...
@@ -1936,7 +1941,7 @@ static int set_config_cap_drop(const char *key, const char *value,
return
ret
;
return
ret
;
}
}
static
int
set_config_console
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_console
_path
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
return
set_config_path_item
(
&
lxc_conf
->
console
.
path
,
value
);
return
set_config_path_item
(
&
lxc_conf
->
console
.
path
,
value
);
...
@@ -3153,7 +3158,7 @@ static int get_config_cap_keep(const char *key, char *retv, int inlen,
...
@@ -3153,7 +3158,7 @@ static int get_config_cap_keep(const char *key, char *retv, int inlen,
return
fulllen
;
return
fulllen
;
}
}
static
int
get_config_console
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
static
int
get_config_console
_path
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
struct
lxc_conf
*
c
,
void
*
data
)
struct
lxc_conf
*
c
,
void
*
data
)
{
{
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
console
.
path
);
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
console
.
path
);
...
@@ -3508,7 +3513,7 @@ static inline int clr_config_cap_keep(const char *key, struct lxc_conf *c,
...
@@ -3508,7 +3513,7 @@ static inline int clr_config_cap_keep(const char *key, struct lxc_conf *c,
return
lxc_clear_config_keepcaps
(
c
);
return
lxc_clear_config_keepcaps
(
c
);
}
}
static
inline
int
clr_config_console
(
const
char
*
key
,
struct
lxc_conf
*
c
,
static
inline
int
clr_config_console
_path
(
const
char
*
key
,
struct
lxc_conf
*
c
,
void
*
data
)
void
*
data
)
{
{
free
(
c
->
console
.
path
);
free
(
c
->
console
.
path
);
...
...
src/lxc/criu.c
View file @
3aed4934
...
@@ -83,7 +83,7 @@ struct criu_opts {
...
@@ -83,7 +83,7 @@ struct criu_opts {
/* The path that is bind mounted from /dev/console, if any. We don't
/* The path that is bind mounted from /dev/console, if any. We don't
* want to use `--ext-mount-map auto`'s result here because the pts
* want to use `--ext-mount-map auto`'s result here because the pts
* device may have a different path (e.g. if the pty number is
* device may have a different path (e.g. if the pty number is
* different) on the target host. NULL if lxc.console = "none".
* different) on the target host. NULL if lxc.console
.path
= "none".
*/
*/
char
*
console_name
;
char
*
console_name
;
...
@@ -106,8 +106,8 @@ static int load_tty_major_minor(char *directory, char *output, int len)
...
@@ -106,8 +106,8 @@ static int load_tty_major_minor(char *directory, char *output, int len)
f
=
fopen
(
path
,
"r"
);
f
=
fopen
(
path
,
"r"
);
if
(
!
f
)
{
if
(
!
f
)
{
/* This means we're coming from a liblxc which didn't export
/* This means we're coming from a liblxc which didn't export
* the tty info. In this case they had to have lxc.console
=
* the tty info. In this case they had to have lxc.console
.path
* none, so there's no problem restoring.
*
= *
none, so there's no problem restoring.
*/
*/
if
(
errno
==
ENOENT
)
if
(
errno
==
ENOENT
)
return
0
;
return
0
;
...
@@ -450,7 +450,7 @@ static void exec_criu(struct criu_opts *opts)
...
@@ -450,7 +450,7 @@ static void exec_criu(struct criu_opts *opts)
if
(
tty_info
[
0
])
{
if
(
tty_info
[
0
])
{
if
(
opts
->
console_fd
<
0
)
{
if
(
opts
->
console_fd
<
0
)
{
ERROR
(
"lxc.console configured on source host but not target"
);
ERROR
(
"lxc.console
.path
configured on source host but not target"
);
goto
err
;
goto
err
;
}
}
...
...
src/tests/lxc-test-checkpoint-restore
View file @
3aed4934
...
@@ -31,7 +31,7 @@ lxc-create -t ubuntu -n $name || FAIL "creating container"
...
@@ -31,7 +31,7 @@ lxc-create -t ubuntu -n $name || FAIL "creating container"
cat
>>
"
$(
lxc-config lxc.lxcpath
)
/
$name
/config"
<<
EOF
cat
>>
"
$(
lxc-config lxc.lxcpath
)
/
$name
/config"
<<
EOF
# hax for criu
# hax for criu
lxc.console = none
lxc.console
.path
= none
lxc.tty = 0
lxc.tty = 0
lxc.cgroup.devices.deny = c 5:1 rwm
lxc.cgroup.devices.deny = c 5:1 rwm
EOF
EOF
...
...
src/tests/parse_config_file.c
View file @
3aed4934
...
@@ -628,13 +628,22 @@ int main(int argc, char *argv[])
...
@@ -628,13 +628,22 @@ int main(int argc, char *argv[])
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.console */
/* REMOVE IN LXC 3.0
legacy lxc.console key
*/
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.console"
,
"none"
,
tmpf
,
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.console"
,
"none"
,
tmpf
,
true
)
<
0
)
{
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.console"
);
lxc_error
(
"%s
\n
"
,
"lxc.console"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.console.path */
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.console.path"
,
"none"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.console.path"
);
goto
non_test_error
;
}
/* lxc.console.logfile */
/* lxc.console.logfile */
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.console.logfile"
,
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.console.logfile"
,
"/some/logfile"
,
tmpf
,
true
)
<
0
)
{
"/some/logfile"
,
tmpf
,
true
)
<
0
)
{
...
...
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