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
70cc6755
Commit
70cc6755
authored
Oct 10, 2017
by
Serge Hallyn
Committed by
GitHub
Oct 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1849 from brauner/2017-10-10/update_config
confile: make update warning opt-in
parents
7c8f5d1d
70952c01
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
74 additions
and
12 deletions
+74
-12
confile.c
src/lxc/confile.c
+9
-7
lxc_attach.c
src/lxc/tools/lxc_attach.c
+3
-0
lxc_autostart.c
src/lxc/tools/lxc_autostart.c
+3
-0
lxc_cgroup.c
src/lxc/tools/lxc_cgroup.c
+7
-3
lxc_checkpoint.c
src/lxc/tools/lxc_checkpoint.c
+3
-0
lxc_clone.c
src/lxc/tools/lxc_clone.c
+2
-0
lxc_config.c
src/lxc/tools/lxc_config.c
+2
-0
lxc_console.c
src/lxc/tools/lxc_console.c
+3
-0
lxc_copy.c
src/lxc/tools/lxc_copy.c
+3
-0
lxc_create.c
src/lxc/tools/lxc_create.c
+3
-0
lxc_destroy.c
src/lxc/tools/lxc_destroy.c
+3
-1
lxc_device.c
src/lxc/tools/lxc_device.c
+3
-0
lxc_execute.c
src/lxc/tools/lxc_execute.c
+3
-0
lxc_freeze.c
src/lxc/tools/lxc_freeze.c
+3
-0
lxc_info.c
src/lxc/tools/lxc_info.c
+3
-0
lxc_ls.c
src/lxc/tools/lxc_ls.c
+3
-0
lxc_monitor.c
src/lxc/tools/lxc_monitor.c
+3
-0
lxc_snapshot.c
src/lxc/tools/lxc_snapshot.c
+3
-1
lxc_start.c
src/lxc/tools/lxc_start.c
+3
-0
lxc_stop.c
src/lxc/tools/lxc_stop.c
+3
-0
lxc_unfreeze.c
src/lxc/tools/lxc_unfreeze.c
+3
-0
lxc_wait.c
src/lxc/tools/lxc_wait.c
+3
-0
No files found.
src/lxc/confile.c
View file @
70cc6755
...
@@ -2009,13 +2009,15 @@ static int parse_line(char *buffer, void *data)
...
@@ -2009,13 +2009,15 @@ static int parse_line(char *buffer, void *data)
/* [START]: REMOVE IN LXC 3.0 */
/* [START]: REMOVE IN LXC 3.0 */
if
(
config
->
is_legacy_key
&&
!
plc
->
conf
->
contains_legacy_key
)
{
if
(
config
->
is_legacy_key
&&
!
plc
->
conf
->
contains_legacy_key
)
{
plc
->
conf
->
contains_legacy_key
=
true
;
plc
->
conf
->
contains_legacy_key
=
true
;
/* Warn the user once loud and clear that there is at least one
if
(
getenv
(
"LXC_UPDATE_CONFIG_FORMAT"
))
{
* legacy configuration item in the configuration file and then
/* Warn the user once loud and clear that there is at
* an update is required.
* least one legacy configuration item in the
*/
* configuration file and then an update is required.
fprintf
(
stderr
,
"The configuration file contains legacy "
*/
"configuration keys.
\n
Please update your "
fprintf
(
stderr
,
"The configuration file contains "
"configuration file!
\n
"
);
"legacy configuration keys.
\n
Please "
"update your configuration file!
\n
"
);
}
}
}
/* [END]: REMOVE IN LXC 3.0 */
/* [END]: REMOVE IN LXC 3.0 */
...
...
src/lxc/tools/lxc_attach.c
View file @
70cc6755
...
@@ -406,6 +406,9 @@ int main(int argc, char *argv[])
...
@@ -406,6 +406,9 @@ int main(int argc, char *argv[])
}
}
}
}
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
struct
lxc_container
*
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
struct
lxc_container
*
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
if
(
!
c
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
...
src/lxc/tools/lxc_autostart.c
View file @
70cc6755
...
@@ -368,6 +368,9 @@ int main(int argc, char *argv[])
...
@@ -368,6 +368,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
count
=
list_defined_containers
(
my_args
.
lxcpath
[
0
],
NULL
,
&
containers
);
count
=
list_defined_containers
(
my_args
.
lxcpath
[
0
],
NULL
,
&
containers
);
if
(
count
<
0
)
if
(
count
<
0
)
...
...
src/lxc/tools/lxc_cgroup.c
View file @
70cc6755
...
@@ -21,16 +21,17 @@
...
@@ -21,16 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include <libgen.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#include <libgen.h>
#include <sys/types.h>
#include <sys/types.h>
#include <lxc/lxccontainer.h>
#include <lxc/lxccontainer.h>
#include "lxc.h"
#include "log.h"
#include "arguments.h"
#include "arguments.h"
#include "log.h"
#include "lxc.h"
lxc_log_define
(
lxc_cgroup_ui
,
lxc
);
lxc_log_define
(
lxc_cgroup_ui
,
lxc
);
...
@@ -86,6 +87,9 @@ int main(int argc, char *argv[])
...
@@ -86,6 +87,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
state_object
=
my_args
.
argv
[
0
];
state_object
=
my_args
.
argv
[
0
];
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
...
...
src/lxc/tools/lxc_checkpoint.c
View file @
70cc6755
...
@@ -255,6 +255,9 @@ int main(int argc, char *argv[])
...
@@ -255,6 +255,9 @@ int main(int argc, char *argv[])
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
fprintf
(
stderr
,
"System error loading %s
\n
"
,
my_args
.
name
);
fprintf
(
stderr
,
"System error loading %s
\n
"
,
my_args
.
name
);
...
...
src/lxc/tools/lxc_clone.c
View file @
70cc6755
...
@@ -176,6 +176,8 @@ int main(int argc, char *argv[])
...
@@ -176,6 +176,8 @@ int main(int argc, char *argv[])
usage
(
argv
[
0
]);
usage
(
argv
[
0
]);
}
}
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c1
=
lxc_container_new
(
orig
,
lxcpath
);
c1
=
lxc_container_new
(
orig
,
lxcpath
);
if
(
!
c1
)
if
(
!
c1
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
...
src/lxc/tools/lxc_config.c
View file @
70cc6755
...
@@ -62,6 +62,8 @@ int main(int argc, char *argv[])
...
@@ -62,6 +62,8 @@ int main(int argc, char *argv[])
struct
lxc_config_items
*
i
;
struct
lxc_config_items
*
i
;
const
char
*
value
;
const
char
*
value
;
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
if
(
argc
<
2
)
if
(
argc
<
2
)
usage
(
argv
[
0
]);
usage
(
argv
[
0
]);
if
(
strcmp
(
argv
[
1
],
"-l"
)
==
0
)
if
(
strcmp
(
argv
[
1
],
"-l"
)
==
0
)
...
...
src/lxc/tools/lxc_console.c
View file @
70cc6755
...
@@ -119,6 +119,9 @@ int main(int argc, char *argv[])
...
@@ -119,6 +119,9 @@ int main(int argc, char *argv[])
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
fprintf
(
stderr
,
"System error loading container
\n
"
);
fprintf
(
stderr
,
"System error loading container
\n
"
);
...
...
src/lxc/tools/lxc_copy.c
View file @
70cc6755
...
@@ -190,6 +190,9 @@ int main(int argc, char *argv[])
...
@@ -190,6 +190,9 @@ int main(int argc, char *argv[])
exit
(
ret
);
exit
(
ret
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
if
(
geteuid
())
{
if
(
geteuid
())
{
if
(
access
(
my_args
.
lxcpath
[
0
],
O_RDONLY
)
<
0
)
{
if
(
access
(
my_args
.
lxcpath
[
0
],
O_RDONLY
)
<
0
)
{
if
(
!
my_args
.
quiet
)
if
(
!
my_args
.
quiet
)
...
...
src/lxc/tools/lxc_create.c
View file @
70cc6755
...
@@ -229,6 +229,9 @@ int main(int argc, char *argv[])
...
@@ -229,6 +229,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
if
(
!
my_args
.
template
)
{
if
(
!
my_args
.
template
)
{
fprintf
(
stderr
,
"A template must be specified.
\n
"
);
fprintf
(
stderr
,
"A template must be specified.
\n
"
);
fprintf
(
stderr
,
"Use
\"
none
\"
if you really want a container without a rootfs.
\n
"
);
fprintf
(
stderr
,
"Use
\"
none
\"
if you really want a container without a rootfs.
\n
"
);
...
...
src/lxc/tools/lxc_destroy.c
View file @
70cc6755
...
@@ -89,6 +89,9 @@ int main(int argc, char *argv[])
...
@@ -89,6 +89,9 @@ int main(int argc, char *argv[])
if
(
my_args
.
quiet
)
if
(
my_args
.
quiet
)
quiet
=
true
;
quiet
=
true
;
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
if
(
!
quiet
)
if
(
!
quiet
)
...
@@ -278,4 +281,3 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
...
@@ -278,4 +281,3 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
return
bret
;
return
bret
;
}
}
src/lxc/tools/lxc_device.c
View file @
70cc6755
...
@@ -127,6 +127,9 @@ int main(int argc, char *argv[])
...
@@ -127,6 +127,9 @@ int main(int argc, char *argv[])
goto
err
;
goto
err
;
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
ERROR
(
"%s doesn't exist"
,
my_args
.
name
);
ERROR
(
"%s doesn't exist"
,
my_args
.
name
);
...
...
src/lxc/tools/lxc_execute.c
View file @
70cc6755
...
@@ -136,6 +136,9 @@ int main(int argc, char *argv[])
...
@@ -136,6 +136,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
ERROR
(
"Failed to create lxc_container"
);
ERROR
(
"Failed to create lxc_container"
);
...
...
src/lxc/tools/lxc_freeze.c
View file @
70cc6755
...
@@ -76,6 +76,9 @@ int main(int argc, char *argv[])
...
@@ -76,6 +76,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
ERROR
(
"No such container: %s:%s"
,
my_args
.
lxcpath
[
0
],
my_args
.
name
);
ERROR
(
"No such container: %s:%s"
,
my_args
.
lxcpath
[
0
],
my_args
.
name
);
...
...
src/lxc/tools/lxc_info.c
View file @
70cc6755
...
@@ -413,6 +413,9 @@ int main(int argc, char *argv[])
...
@@ -413,6 +413,9 @@ int main(int argc, char *argv[])
exit
(
ret
);
exit
(
ret
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
if
(
print_info
(
my_args
.
name
,
my_args
.
lxcpath
[
0
])
==
0
)
if
(
print_info
(
my_args
.
name
,
my_args
.
lxcpath
[
0
])
==
0
)
ret
=
EXIT_SUCCESS
;
ret
=
EXIT_SUCCESS
;
...
...
src/lxc/tools/lxc_ls.c
View file @
70cc6755
...
@@ -233,6 +233,9 @@ int main(int argc, char *argv[])
...
@@ -233,6 +233,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
struct
lengths
max_len
=
{
struct
lengths
max_len
=
{
/* default header length */
/* default header length */
.
name_length
=
4
,
/* NAME */
.
name_length
=
4
,
/* NAME */
...
...
src/lxc/tools/lxc_monitor.c
View file @
70cc6755
...
@@ -113,6 +113,9 @@ int main(int argc, char *argv[])
...
@@ -113,6 +113,9 @@ int main(int argc, char *argv[])
exit
(
rc_main
);
exit
(
rc_main
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
if
(
quit_monitord
)
{
if
(
quit_monitord
)
{
int
ret
=
EXIT_SUCCESS
;
int
ret
=
EXIT_SUCCESS
;
for
(
i
=
0
;
i
<
my_args
.
lxcpath_cnt
;
i
++
)
{
for
(
i
=
0
;
i
<
my_args
.
lxcpath_cnt
;
i
++
)
{
...
...
src/lxc/tools/lxc_snapshot.c
View file @
70cc6755
...
@@ -101,6 +101,9 @@ int main(int argc, char *argv[])
...
@@ -101,6 +101,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
if
(
geteuid
())
{
if
(
geteuid
())
{
if
(
access
(
my_args
.
lxcpath
[
0
],
O_RDONLY
)
<
0
)
{
if
(
access
(
my_args
.
lxcpath
[
0
],
O_RDONLY
)
<
0
)
{
fprintf
(
stderr
,
"You lack access to %s
\n
"
,
fprintf
(
stderr
,
"You lack access to %s
\n
"
,
...
@@ -304,4 +307,3 @@ static void print_file(char *path)
...
@@ -304,4 +307,3 @@ static void print_file(char *path)
free
(
line
);
free
(
line
);
fclose
(
f
);
fclose
(
f
);
}
}
src/lxc/tools/lxc_start.c
View file @
70cc6755
...
@@ -244,6 +244,9 @@ int main(int argc, char *argv[])
...
@@ -244,6 +244,9 @@ int main(int argc, char *argv[])
const
char
*
lxcpath
=
my_args
.
lxcpath
[
0
];
const
char
*
lxcpath
=
my_args
.
lxcpath
[
0
];
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
/*
/*
* rcfile possibilities:
* rcfile possibilities:
* 1. rcfile from random path specified in cli option
* 1. rcfile from random path specified in cli option
...
...
src/lxc/tools/lxc_stop.c
View file @
70cc6755
...
@@ -173,6 +173,9 @@ int main(int argc, char *argv[])
...
@@ -173,6 +173,9 @@ int main(int argc, char *argv[])
exit
(
ret
);
exit
(
ret
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
/* Set default timeout */
/* Set default timeout */
if
(
my_args
.
timeout
==
-
2
)
{
if
(
my_args
.
timeout
==
-
2
)
{
if
(
my_args
.
hardstop
)
if
(
my_args
.
hardstop
)
...
...
src/lxc/tools/lxc_unfreeze.c
View file @
70cc6755
...
@@ -75,6 +75,9 @@ int main(int argc, char *argv[])
...
@@ -75,6 +75,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
ERROR
(
"No such container: %s:%s"
,
my_args
.
lxcpath
[
0
],
my_args
.
name
);
ERROR
(
"No such container: %s:%s"
,
my_args
.
lxcpath
[
0
],
my_args
.
name
);
...
...
src/lxc/tools/lxc_wait.c
View file @
70cc6755
...
@@ -102,6 +102,9 @@ int main(int argc, char *argv[])
...
@@ -102,6 +102,9 @@ int main(int argc, char *argv[])
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
if
(
!
c
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
...
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