Commit Graph

5727 Commits

Author SHA1 Message Date
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
0x0916
55c84efcba confile: namespace lxc.signal keys
* rename lxc.haltsignal to lxc.signal.halt
* rename lxc.rebootsignal to lxc.signal.reboot
* rename lxc.stopsignal to lxc.signal.stop

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
0x0916
46cc906dc0 confile: namespace lxc.log keys
* rename lxc.logfile to lxc.log.file
* renaem lxc.loglevel to lxc.log.level
* rename lxc.syslog to lxc.log.syslog

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:04 +08:00
0x0916
9dcf7b4d23 confile: namespace lxc.init keys
* rename lxc.init_cmd to lxc.init.cmd
* rename lxc.init_uid to lxc.init.uid
* rename lxc.init_gid to lxc.init.gid

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-29 22:14:46 +08:00
0x0916
240d4b74ce confile: rename lxc.limit to lxc.prlimit
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 22:14:34 +08:00
Christian Brauner
86ccab2e9b Merge pull request #1649 from 0x0916/2017-06-27/wipe-lxc-network-references
wipe all references lxc.network.{[i]}.* and replace with lxc.net.[i].*
2017-06-29 13:17:59 +02:00
0x0916
c2dbbbb612 confile_legacy: fix lxc_clear_nic error
`lxc_clear_nic` can not clear the nic, because it will not found
the right `netdev`.

testcase from get_item.c

```
313         if (!c->set_config_item(c, "lxc.network.hwaddr", "00:16:3e:xx:xx:xx")) {
314                 fprintf(stderr, "%d: failed to set network.hwaddr\n", __LINE__);
315                 goto out;
316         }
317         if (!c->set_config_item(c, "lxc.network.ipv4", "10.2.3.4")) {
318                 fprintf(stderr, "%d: failed to set ipv4\n", __LINE__);
319                 goto out;
320         }
321
322         ret = c->get_config_item(c, "lxc.network.0.ipv4", v2, 255);
323         if (ret <= 0) {
324                 fprintf(stderr, "%d: lxc.network.0.ipv4 returned %d\n", __LINE__, ret);
325                 goto out;
326         }
327         if (!c->clear_config_item(c, "lxc.network.0.ipv4")) {
328                 fprintf(stderr, "%d: failed clearing all ipv4 entries\n", __LINE__);
329                 goto out;
330         }
331         ret = c->get_config_item(c, "lxc.network.0.ipv4", v2, 255);
332         if (ret != 0) {
333                 fprintf(stderr, "%d: after clearing ipv4 entries get_item(lxc.network.0.ipv4 returned %d\n", __LINE__, ret);
334                 goto out;
335         }
```

line `327` will failed to clear nic, and line `333` give the error.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:32:16 +08:00
0x0916
935cfd3e36 testcase: define a network before checks
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
0x0916
ae1dc8b42e confile_utils: supporting new net hwaddr key in update_hwaddr
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
0x0916
4a787c27b2 confile: supporting new net hwaddr key in network_new_hwaddrs
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
0x0916
ce4be612ce confile_utils: add lxc_config_net_hwaddr
`lxc_config_net_hwaddr` return true if the config entry
is `lxc.network.hwaddr` or `lxc.net.[i].hwaddr`, `lxc.network.[i].hwaddr`

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
0x0916
82c3a0dc57 confile: update comment: replace p+12 with p+8
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
0x0916
7fa3f2e9eb replace all lxc.network* with lxc.net*
This patch wipe all references to lxc.network{[i]}.*
and replace with lxc.net.{[i]}.* in templates, documentation
and configuration files.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-29 13:18:41 +08:00
Christian Brauner
18ede42752 Merge pull request #1652 from 0x0916/2017-06-27/free-downscript
confile: free netdev->downscript
2017-06-27 21:14:45 +02:00
0x0916
e07629138f confile: free netdev->downscript
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-27 22:12:38 +08:00
Christian Brauner
3129a46f47 Merge pull request #1650 from 0x0916/2017-06-27/refactor-confile-code
refactor confile code
2017-06-27 10:43:35 +02:00
0x0916
71e287cad3 refactor confile code
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-27 15:54:23 +08:00
Serge Hallyn
c949f5cc0e Merge pull request #1639 from brauner/2017-06-23/lxc_2_1_preparations
confile: prepare for 2.1.
2017-06-26 09:13:47 -05:00
Christian Brauner
a3711f5246 Merge pull request #1648 from 0x0916/remove-__func__
remove the `__func__` macro
2017-06-26 14:29:23 +02:00
Christian Brauner
d6cb82ac01 Merge pull request #1647 from 0x0916/update-api-doc
API doc: update note for get_config_item
2017-06-26 12:03:42 +02:00
0x0916
b103ceac2c remove the __func__ macro
Our logging function will always spew out the function name.

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-26 17:55:12 +08:00
0x0916
13a4215bfb API doc: update note for get_config_item
Fix issue: https://github.com/lxc/lxc/issues/505

Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-26 17:33:10 +08:00
Christian Brauner
488364568d Merge pull request #1644 from evgeni/centos-7
default to CentOS 7
2017-06-25 10:00:30 +02:00
Christian Brauner
79aa9f9f44 Merge pull request #1643 from evgeni/aarch64
templates/debian: add aarch64 → arm64 mapping
2017-06-24 19:37:38 +02:00
Christian Brauner
cb54b5798a Merge pull request #1645 from evgeni/centos-altarch
use altarch mirror for CentOS on arches other than i386 and x86_64
2017-06-24 19:37:25 +02:00
Evgeni Golov
e54bd54f5a use altarch mirror for CentOS on arches other than i386 and x86_64
CentOS only has i386 and x86_64 listed in mirrorlist.centos.org,
use http://mirror.centos.org/altarch/ for all other arches instead

See: https://bugs.centos.org/view.php?id=11250

Signed-off-by: Evgeni Golov <evgeni@debian.org>
2017-06-24 19:32:17 +02:00
Evgeni Golov
420382d598 default to CentOS 7
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2017-06-24 18:56:22 +02:00
Evgeni Golov
2c66050352 templates/debian: add aarch64 → arm64 mapping
uname -m reports aarch64, but Debian calls the arch arm64

Signed-off-by: Evgeni Golov <evgeni@debian.org>
2017-06-24 18:40:39 +02:00
Christian Brauner
58c89a1422 Merge pull request #1635 from 0x0916/instead-of-strerror
Use strerror(errno) instead of %m
2017-06-23 18:10:46 +02:00
Christian Brauner
a0075d68b1 Merge pull request #1640 from 0x0916/update-ignore-file
update .gitignore
2017-06-23 18:00:10 +02:00
0x0916
58e49ed2c7 update .gitignore
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-23 23:17:29 +08:00
0x0916
13277ec49c Use strerror(errno) instead of %m
Signed-off-by: 0x0916 <w@laoqinren.net>
2017-06-23 23:10:49 +08:00
Christian Brauner
39b8f404dc
confile: remove lxc.pivotdir
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-23 16:00:24 +02:00
Christian Brauner
26a38fb6aa
confile: remove lxc.kmsg
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-23 16:00:23 +02:00
Christian Brauner
953fe44f7c
confile: properly namespace security keys
- lxc.aa_profile => lxc.apparmor.profile
- lxc.aa_allow_incomplete => lxc.apparmor.allow_incomplete
- lxc.se_context => lxc.selinux.context

The legacy keys will be kept around until LXC 3.0 and then will be removed.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-23 15:37:55 +02:00
Christian Brauner
af36a8ee9c Merge pull request #1638 from 0x0916/fix-memory-resource-leak
fix memory and resource leak
2017-06-23 15:34:15 +02:00