Commit Graph

6412 Commits

Author SHA1 Message Date
Long Wang
df24d43699 tests: remove the temp container directory
c->destory() will not remove the temp container directory.
This patch fix that.

Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 15:17:58 +08:00
Long Wang
6cd5db20bc tests: create temp file before lxc_container_new
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 14:51:03 +08:00
Long Wang
3705503ac3 use same ifndef/define format for all headers
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 14:06:01 +08:00
Long Wang
74a99f40b3 caps.h: move ifndef/define to the top
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 12:19:37 +08:00
Long Wang
16affc24a5 lxc-init: move initialization of act to outside of the loop
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 12:13:09 +08:00
Long Wang
1574fc2495 lxc-init: adjust include statements
* Use `#include <lxc/lxccontaienr.h>` style for exported haeders.
* remove used header `caps.h`

Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 12:12:38 +08:00
Long Wang
1bfb12006f lxc-init: non-functional changes
This patch mainly update the message format to:

* upper the first letter
* end without a dot

all changes are relate to `lxc-init`

Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 12:12:13 +08:00
Long Wang
55684fd822 lxc-init: add comment for exclude 32 and 33 signals
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-05 12:10:54 +08:00
Christian Brauner
978a73831c Merge pull request #1674 from 0x0916/2017-07-04/lxc-execute
lxc-execute: print error message when failed
2017-07-04 15:18:55 +02:00
Long Wang
6de247e335 lxc-execute: print error message when failed
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-04 16:16:30 +08:00
Christian Brauner
ea033bbcac
README: update
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-04 00:15:05 +02:00
Stéphane Graber
b5398df96c Merge pull request #1672 from brauner/2017-07-03/add_cii_best_practices_badge_to_readme
README: add CII Best Practices badge to README
2017-07-03 14:51:51 -04:00
Christian Brauner
0b39b2a9cc
README: add CII Best Practices badge to README
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-03 20:42:18 +02:00
Christian Brauner
cf4a661bda Merge pull request #1668 from 0x0916/2017-07-03/lxclock
lxclock: bugfix and update some comment
2017-07-03 11:30:59 +02:00
Long Wang
ccfc84ca9f lxclock: non-functional changes
This patch mainly updates comments based on the current code.

Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-03 15:43:34 +08:00
Long Wang
98375790a4 lxclock: return the right error when open lock file failed
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-03 15:41:25 +08:00
Christian Brauner
b51eb5ca3a Merge pull request #1667 from 0x0916/2017-07-02/fix-cppcheck-warnings
fix some cppcheck warnings
2017-07-02 17:47:36 +02:00
Christian Brauner
26b9df9dc7 Merge pull request #1666 from 0x0916/2017-07-02/remove-unused-code
remove the unused macro
2017-07-02 17:46:29 +02:00
0x0916
6fc7d8b63e fix some cppcheck warnings
use cppcheck tools `cppcheck --enable=warning  .` on lxc source directory.

This patch fix the following warnning

```
[src/lxc/cgroups/cgfs.c:794]: (warning) %ld in format string (no. 3) requires 'long' but the argument type is 'unsigned long'.
[src/lxc/confile.c:4441]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/confile.c:4502]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/confile_legacy.c:921]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/confile_legacy.c:938]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/lxc/lxclock.c:63]: (warning) %zd in format string (no. 1) requires 'ssize_t' but the argument type is 'size_t {aka unsigned long}'.
[src/lxc/tools/lxc_info.c:118]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:118]: (warning) %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:123]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:127]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_info.c:130]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:212]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:212]: (warning) %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:217]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:221]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/lxc/tools/lxc_top.c:224]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
```

Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-02 22:18:16 +08:00
0x0916
157ad8d409 remove the unused macro
Signed-off-by: Long Wang <w@laoqinren.net>
2017-07-02 22:17:01 +08:00
Christian Brauner
0b427da0e7
confile: lxc.seccomp --> lxc.seccomp.profile
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:07 +02:00
Christian Brauner
232763d645
confile: lxc.pts --> lxc.pty.max
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:07 +02:00
Christian Brauner
fe1c588797
confile: lxc.tty --> lxc.tty.max
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:07 +02:00
Christian Brauner
2e44ae28dc
confile: lxc.net.ipv6 --> lxc.net.ipv6.address
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:06 +02:00
Christian Brauner
9ff60df25b
confile: lxc.net.ipv4 --> lxc.net.ipv4.address
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:06 +02:00
Christian Brauner
47148e96e3
confile: lxc.mount --> lxc.mount.fstab
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:06 +02:00
Christian Brauner
3aed493406
confile: lxc.console --> lxc.console.path
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:06 +02:00
Christian Brauner
7a96a068f8
confile: lxc.rootfs --> lxc.rootfs.path
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:06 +02:00
Christian Brauner
3e01c200b1
doc: remove lxc.rootfs.backend
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:06 +02:00
Christian Brauner
4b19d74290
test: fix tests
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:05 +02:00
Christian Brauner
4d463f625b
storage: handle prefixed rootfs paths
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:05 +02:00
Christian Brauner
db46c21328
storage: prefix all zfs paths
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:05 +02:00
Christian Brauner
43bd0ebf97
storage: prefix all rbd paths
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:05 +02:00
Christian Brauner
094c1904a5
storage: prefix all nbd paths
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:05 +02:00
Christian Brauner
11274f6987
storage: prefix all lvm paths
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:05 +02:00
Christian Brauner
3f88da0e78
storage: prefix all btrfs paths
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:05 +02:00
Christian Brauner
e97055507f
storage: prefix all dir paths
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:04 +02:00
Christian Brauner
4f25fd3847
storage: add lxc_storage_get_path()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:04 +02:00
Christian Brauner
f2d5a09dcb
storage: add storage_utils.{c.h}
non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:04 +02:00
Christian Brauner
f7ac445948
storage: deprecate lxc.rootfs.backend
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-07-02 14:40:04 +02:00
Christian Brauner
c6f7b9513a Merge pull request #1591 from grzgrzgrz3/regres-lxc-ls
lxc-ls: return all containers by default, new filter - list only defi…
2017-07-02 14:31:03 +02:00
Stéphane Graber
05e7cd4aec Merge pull request #1664 from d4s/altlinux-template
Added '--apt-conf' argument for ALTLinux template.
2017-07-02 02:06:35 -04:00
Denis Pynkin
bffda95b20 Added '--apt-conf' argument for ALTLinux template.
Added [-a|--apt-conf] parameter for selection of exact package
providing 'apt-conf'. By default 'apt-conf-sisyphus' is used for
Sisyphus and 'apt-conf-branch' for the rest of branches.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
2017-07-01 17:30:17 +03:00
Christian Brauner
5147c5ee9d Merge pull request #1658 from 0x0916/2017-06-30/new-configuration-keys
new configuration keys
2017-07-01 13:09:28 +02:00
Christian Brauner
fe9a13f700 Merge pull request #1661 from 0x0916/2017-07-01/fix-set-state-error
start: send state to legacy lxc-monitord state server even if no state clients registered
2017-07-01 13:08:35 +02:00
0x0916
65ee1673f6 start: send state to legacy lxc-monitord state server even if no state clients registered
This pr https://github.com/lxc/lxc/pull/1618 kill lxc-monitord, for backwards compatibility,
we also send state to legacy lxc-monitord state server in function `lxc_set_state`.

we should also send state if there is no state clients registered, otherwise `lxc-monitor` client will
not get state change event if container changed state to `STARTING` or `RUNNING`.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-07-01 18:07:02 +08:00
Christian Brauner
066e9fe8b5 Merge pull request #1662 from 0x0916/2017-07-01/lxc-monitor-quit
lxc-monitord: exit when got a quit command
2017-07-01 11:43:14 +02:00
0x0916
267bc7eda8 lxc-monitord: exit when got a quit command
lxc-monitor has an option to tell lxc-monitord to quit.

```
~/lxc (master) # lxc-monitor --help
lxc-monitor monitors the state of the NAME container

Options :
  -n, --name=NAME   NAME of the container
                    NAME may be a regular expression
  -Q, --quit        tell lxc-monitord to quit
```
But it does not work. This patch fix that.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-07-01 14:06:00 +08:00
0x0916
b67771bc26 confile: rename lxc.utsname to lxc.uts.name
the legacy keys will be kept around until LXC 3.0 and then will be
removed.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-30 09:43:53 +08:00
0x0916
42e53c2920 confile: rename lxc.devttydir to lxc.tty.dir
the legacy keys will be kept around until LXC 3.0 and then will be
removed

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-30 09:41:25 +08:00