]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
6 years agolxc-user-nic: free memory and check for error
Christian Brauner [Thu, 31 Aug 2017 21:08:28 +0000 (23:08 +0200)]
lxc-user-nic: free memory and check for error

- check for error on ifindex retrieval
- free allocated memory

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: non-functional changes
Christian Brauner [Thu, 31 Aug 2017 21:01:46 +0000 (23:01 +0200)]
start: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: retrieve the host's veth device ifindex
Christian Brauner [Thu, 31 Aug 2017 20:58:30 +0000 (22:58 +0200)]
network: retrieve the host's veth device ifindex

- Retrieve the host's veth device ifindex in the host's network namespace.
- Add a note why we retrieve the container's veth device ifindex in the host's
  network namespace.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1772 from brauner/2017-08-31/ensure_lxc_user_nic_tests_privilege_...
Serge Hallyn [Thu, 31 Aug 2017 17:15:22 +0000 (12:15 -0500)]
Merge pull request #1772 from brauner/2017-08-31/ensure_lxc_user_nic_tests_privilege_over_netns

lxc-user-nic: test privilege over netns on delete

6 years agonetwork: rework network creation
Christian Brauner [Thu, 31 Aug 2017 13:30:39 +0000 (15:30 +0200)]
network: rework network creation

- On unprivileged veth network creation have lxc-user-nic send the names of the
  veth devices and their respective ifindeces. The advantage of retrieving this
  information from lxc-user-nic is that we spare us sending around more stuff
  via the netpipe in start.c. Also, lxc-user-nic operates in both namespaces
  (the container's namespace and the hosts's namespace) via setns and so is
  guaranteed to retrieve the correct ifindex via if_nametoindex() which is an
  network namespace aware ioctl() call. While I'm pretty sure the ifindeces for
  veth devices are identical across network namespaces I'm weary to rely on
  this. We need the ifindexes to guarantee safe deletion of unprivileged
  network devices via lxc-user-nic later on since we use them to identify the
  network devices in their corresponding network namespaces.
- Move the network device logging from the child to the parent. The child does
  not have all of the information about the network devices available only the
  few bits it actually needs to now. The monitor process is the only process
  that needs all this information.
- The network creation code for privileged and unprivileged networks was
  previously mangled into one single function but at the same time some of the
  privileged code had additional functions that were called in other places in
  start.c. Let's divide and conquer and split out the privileged and
  unprivileged network creation into completely separate functions. This makes
  what's happening way more clear. This will also have no performance impact
  since either you are privileged and only execute the privileged network
  creation functions or you are unprivileged and only execute the unprivileged
  network creation functions.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: log ifindex for host side veth device
Christian Brauner [Thu, 31 Aug 2017 13:25:16 +0000 (15:25 +0200)]
network: log ifindex for host side veth device

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: document all fields in struct lxc_netdev
Christian Brauner [Thu, 31 Aug 2017 11:23:18 +0000 (13:23 +0200)]
network: document all fields in struct lxc_netdev

This is menial work but I'll thank myself later... a lot.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: add ifindex field for host veth device
Christian Brauner [Thu, 31 Aug 2017 11:19:33 +0000 (13:19 +0200)]
network: add ifindex field for host veth device

We should not just record the ifindex for the container's veth device but also
for the host's veth device. This is useful when {configuring,deconfiguring}
veth devices and becomes crucial when calling our lxc-user-nic setuid helper
where we rely on the ifindex to make decisions about whether we are licensed to
perform certain operations on the veth device in question.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: log veth_attr.pair and veth_attr.veth1
Christian Brauner [Thu, 31 Aug 2017 11:17:11 +0000 (13:17 +0200)]
network: log veth_attr.pair and veth_attr.veth1

If the user specified lxc.net.[i].veth.pair attribute to request that the host
side of a veth pair be given a specific name let's log it at the trace level.
Otherwise, if the user didn't not specify lxc.net.[i].veth.pair veth_attr.veth1
will contain the name of the host side veth device.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: test privilege over netns on delete
Christian Brauner [Wed, 30 Aug 2017 23:32:39 +0000 (01:32 +0200)]
lxc-user-nic: test privilege over netns on delete

When lxc-user-nic is called with the "delete" subcommand we need to make sure
that we are actually privileged over the network namespace for which we are
supposed to delete devices on the host. To this end we require that path to the
affected network namespace is passed. We then setns() to the network namespace
and drop privilege to the caller's real user id. Then we try to delete the
loopback interface which is not possible. If we are privileged over the network
namespace this operation will fail with ENOTSUP. If we are not privileged over
the network namespace we will get EPERM.

This is the first part of the commit. As of now nothing guarantees that the
caller does not just give us a random path to a network namespace it is
privileged over.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfigure: remove slash from cgroup pattern
Christian Brauner [Wed, 30 Aug 2017 14:45:45 +0000 (16:45 +0200)]
configure: remove slash from cgroup pattern

This is the cause of the unnecessary extraneous slashes when creating cgroups.
Our lxc.system.conf page also clearly shows "lxc/%n" as example, not "/lxc%n".

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconsole: non-functional change
Christian Brauner [Wed, 30 Aug 2017 14:37:22 +0000 (16:37 +0200)]
console: non-functional change

Remove executable bit.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1769 from brauner/2017-08-30/improve_empty_cgroup_deletion
Stéphane Graber [Wed, 30 Aug 2017 14:35:06 +0000 (10:35 -0400)]
Merge pull request #1769 from brauner/2017-08-30/improve_empty_cgroup_deletion

Revert "cgfsng: try to delete parent cgroups"

6 years agoconfile: remove unnecessary cleanup code
Christian Brauner [Wed, 30 Aug 2017 10:26:42 +0000 (12:26 +0200)]
confile: remove unnecessary cleanup code

set_config_string_item() already free()s before setting the new value.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoRevert "cgfsng: try to delete parent cgroups"
Christian Brauner [Wed, 30 Aug 2017 10:26:10 +0000 (12:26 +0200)]
Revert "cgfsng: try to delete parent cgroups"

This reverts commit 92c590ae1ea40bc094603ab49c20b785cc88bb1d.

Problem:

    Commit 92c590ae1ea40bc094603ab49c20b785cc88bb1d introduced the following
    behavior:

    > cgfsng: try to delete parent cgroups
    >
    > Say we have
    >
    >     lxc.uts.name = c1
    >     lxc.cgroup.dir = lxd/a/b/c
    >
    > the path for the container's cgroup would be
    >
    >     lxd/a/b/c/c1
    >
    > When the container is shutdown we should not just try to delete "c1" we
    > should also try to delete "c", "b", "a", and "lxd". This is to ensure
    > that we don't leave empty cgroups around thereby increasing the chance
    > that we run into trouble with cgroup limits. The algorithm for this isn't
    > too costly since we can simply stop walking upwards at the first rmdir()
    > failure.

    The algorithm employs recursive_destroy() which opens each directory
    specified in lxc.cgroup.dir and tries to delete each directory within that
    directory. For example, assume "/sys/fs/cgroup/memory/lxd/a/b/c" only
    contains the cgroup "c1" for container "c1". Assume that "c1" calls
    recursive_destroy() to cleanup it's cgroups. It will first delete "c1" and
    anything underneath it. This is perfectly fine since anything underneath
    that cgroup is under its control. The new algorithm will then tell it to
    "recurse upwards". So recursive_destroy() will try to delete
    "/sys/fs/cgroup/lxd/a/b/c" next. Now assume that a second container "c2"
    has "lxc.cgroup.dir = lxd/a/b/c" set in its config file and calls
    cgroup_create(). This will create the *empty* cgroup
    "/sys/fs/cgroup/memory/lxd/a/b/c/c2". Now assume that after having created
    "c2" container "c1"'s call to recursive_destroy() reaches
    "/sys/fs/cgroup/memory/lxd/a/b/c/c2" before it is populated. Then the
    cgroup "c2" will be removed. Now "c2" calls cgroup_enter() to enter its
    created cgroup. This will fail since c1 deleted the cgroup "c2". (As a
    sidenote: This is in the set of the few race conditions that are actually
    easy to describe.)

Possible Solution:

    Instead of calling recursive_destroy() on all cgroups specified in
    lxc.cgroup.dir we only call recursive_destroy() on the container's own
    cgroup "/sys/fs/cgroup/memory/lxd/a/b/c/c1". When we start to recurse
    upwards we only call unlinkat(AT_FDCWD, path, AT_REMOVEDIR). This should
    avoid the race described above. My argument is as follows. Assume that the
    container c1 has created the cgroup "/sys/fs/cgroup/lxd/a/b/c/c1" for
    itself. Now c1 calls cgroup_destroy(). First, recursive_destroy() will be
    called on the cgroup "c1" which will delete any emtpy cgroup directories
    underneath "c1" and finally "c1" itself. This is fine since everything
    under "c1" is the container's c1 sole property. Now container c1 will call
    unlinkat() on "/sys/fs/cgroup/memory/lxd/a/b/c/c1":
    - Assume that in the meantime container c2 has created the cgroup
      "/sys/fs/cgroup/memory/lxd/a/b/c/c2". Then c1's unlinkat() will fail.
      This will stop c1 from recursing upwards. So c2's cgroup_enter() call
      will find all its cgroups intact and well. unlinkat() will come with the
      appropriate in-kernel locking which will stop it from racing with
      mkdir().
    - There's still a subtle race left. c2 might be calling an implementation
      of mkdir -p to try and create e.g. the cgroup
      "/sys/fs/cgroup/memory/lxd/a/b". Let's assume "b" exists then c2 will
      receive EEXIST on "b" and move on to create "c". Let's further assume c1
      has already deleted "c". c1 will now be able to delete
      "/sys/fs/cgroup/memory/lxd/a/b/" and c2's call to create "c" will fail.

The latter subtle race makes me rethink this approach. For now we'll just leave
empty cgroups behind since I don't want to start locking stuff.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1761 from brauner/2017-08-10/further_lxc_2.1_preparations
Serge Hallyn [Tue, 29 Aug 2017 19:57:18 +0000 (14:57 -0500)]
Merge pull request #1761 from brauner/2017-08-10/further_lxc_2.1_preparations

further lxc 2.1 preparations

6 years agoMerge pull request #1767 from xnox/upstart-ssh
Christian Brauner [Tue, 29 Aug 2017 14:52:35 +0000 (16:52 +0200)]
Merge pull request #1767 from xnox/upstart-ssh

templates/ubuntu: conditionally move upstart ssh job, as it is now op…

6 years agotemplates/ubuntu: conditionally move upstart ssh job, as it is now optional.
Dimitri John Ledkov [Tue, 29 Aug 2017 14:11:55 +0000 (15:11 +0100)]
templates/ubuntu: conditionally move upstart ssh job, as it is now optional.

Mimic the code from the debian template.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
6 years agonetwork: non-functional changes
Christian Brauner [Mon, 28 Aug 2017 10:23:29 +0000 (12:23 +0200)]
network: non-functional changes

This moves all of the network handling code into network.{c,h}. This makes what
is going on much clearer. Also it's easier to find relevant code if it is all
in one place.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: increase lxc-user-nic buffer
Christian Brauner [Sun, 27 Aug 2017 12:48:52 +0000 (14:48 +0200)]
conf: increase lxc-user-nic buffer

This will allow us log more detailed failures.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: check db before trying to delete
Christian Brauner [Sun, 27 Aug 2017 07:17:10 +0000 (09:17 +0200)]
lxc-user-nic: check db before trying to delete

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: non-functional changes
Christian Brauner [Sun, 27 Aug 2017 13:03:16 +0000 (15:03 +0200)]
lxc-user-nic: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: delete ovs for unprivileged networks
Christian Brauner [Sun, 27 Aug 2017 03:02:23 +0000 (05:02 +0200)]
network: delete ovs for unprivileged networks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1763 from brauner/2017-08-28/lxc_2.1_upgrade_script
Stéphane Graber [Mon, 28 Aug 2017 16:00:07 +0000 (12:00 -0400)]
Merge pull request #1763 from brauner/2017-08-28/lxc_2.1_upgrade_script

lxc-update-config: handle legacy networks

6 years agolxc-update-config: handle legacy networks
Christian Brauner [Mon, 28 Aug 2017 14:34:07 +0000 (16:34 +0200)]
lxc-update-config: handle legacy networks

Older instances of liblxc allowed to specify networks like this:

lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxdbr0
lxc.network.name= eth0

lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxdbr0
lxc.network.name = eth1

Each occurrence of "lxc.network.type" indicated the definition of a new
network. This syntax is not allowed in newer liblxc instances. Instead, network
must carry an index. So in new liblxc these two networks would be translated to:

lxc.net.0.type = veth
lxc.net.0.flags = up
lxc.net.0.link = lxdbr0
lxc.net.0.name= eth0

lxc.net.1.type = veth
lxc.net.1.flags = up
lxc.net.1.link = lxdbr0
lxc.net.1.name = eth1

The update script did not handle this case correctly. It should now.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: log ifindex
Christian Brauner [Sun, 27 Aug 2017 03:01:14 +0000 (05:01 +0200)]
network: log ifindex

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: send ifindex for unpriv networks
Christian Brauner [Sun, 27 Aug 2017 02:59:57 +0000 (04:59 +0200)]
network: send ifindex for unpriv networks

We use the ifindex as an indicator that liblxc created the network so let's
record it for the unprivileged case as well.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: rework renaming net devices
Christian Brauner [Sat, 26 Aug 2017 22:39:17 +0000 (00:39 +0200)]
lxc-user-nic: rework renaming net devices

This should make things a little less convoluted.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: adapt to lxc-user-nic usage
Christian Brauner [Sat, 26 Aug 2017 21:04:01 +0000 (23:04 +0200)]
conf: adapt to lxc-user-nic usage

- lxc-user-nic gains the subcommands {create,delete}
- dup2() STDERR_FILENO as well so that we can show helpful messages in our logs
  on failure
- initialize output buffer so that we don't print garbage

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotests: adapt lxc-user-nic tests to new syntax
Christian Brauner [Sat, 26 Aug 2017 22:00:58 +0000 (00:00 +0200)]
tests: adapt lxc-user-nic tests to new syntax

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: add new {create,delete} subcommands
Christian Brauner [Sat, 26 Aug 2017 21:16:03 +0000 (23:16 +0200)]
lxc-user-nic: add new {create,delete} subcommands

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: fix memleak
Christian Brauner [Sat, 26 Aug 2017 21:10:18 +0000 (23:10 +0200)]
lxc-user-nic: fix memleak

get_new_nicname() calls lxc_mkifname() which allocates memory and returns it to
the caller. The way get_new_nicname() and get_nic_if_avail() were implemented
they hid that fact by returning a boolean. That doesn't make sense. Let's
rather have them return a pointer to the allocated nic name which the caller
needs to free.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: non-functional changes
Christian Brauner [Sat, 26 Aug 2017 16:53:29 +0000 (18:53 +0200)]
lxc-user-nic: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: try to delete parent cgroups
Christian Brauner [Fri, 25 Aug 2017 09:53:55 +0000 (11:53 +0200)]
cgfsng: try to delete parent cgroups

Say we have

    lxc.uts.name = c1
    lxc.cgroup.dir = lxd/a/b/c

the path for the container's cgroup would be

    lxd/a/b/c/c1

When the container is shutdown we should not just try to delete "c1" we should
also try to delete "c", "b", "a", and "lxd". This is to ensure that we don't
leave empty cgroups around thereby increasing the chance that we run into
trouble with cgroup limits. The algorithm for this isn't too costly since we
can simply stop walking upwards at the first rmdir() failure.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: add container name to lxc.cgroup.dir value
Christian Brauner [Fri, 25 Aug 2017 09:51:05 +0000 (11:51 +0200)]
cgfsng: add container name to lxc.cgroup.dir value

Say we have

    lxc.uts.name = c1
    lxc.cgroup.dir = lxd

the actual path should be

    lxd/c1

Right now it would just be

    lxd

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: non-functional changes
Christian Brauner [Fri, 25 Aug 2017 07:52:14 +0000 (09:52 +0200)]
cgfsng: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: do not deref null pointer
Christian Brauner [Sat, 26 Aug 2017 22:48:34 +0000 (00:48 +0200)]
conf: do not deref null pointer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: non-functional changes
Christian Brauner [Sat, 26 Aug 2017 22:36:40 +0000 (00:36 +0200)]
conf: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1757 from brauner/2017-08-10/further_lxc_2.1_preparations
Stéphane Graber [Fri, 25 Aug 2017 06:04:18 +0000 (02:04 -0400)]
Merge pull request #1757 from brauner/2017-08-10/further_lxc_2.1_preparations

further lxc 2.1 preparations

6 years agoattach: non-functional changes
Christian Brauner [Fri, 25 Aug 2017 05:35:02 +0000 (07:35 +0200)]
attach: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoarguments: non-functional changes
Christian Brauner [Fri, 25 Aug 2017 05:17:20 +0000 (07:17 +0200)]
arguments: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoaf_unix: non-functional changes
Christian Brauner [Fri, 25 Aug 2017 05:11:26 +0000 (07:11 +0200)]
af_unix: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agortnl: non-functional changes
Christian Brauner [Fri, 25 Aug 2017 05:07:43 +0000 (07:07 +0200)]
rtnl: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: do not check union on wrong net type
Christian Brauner [Thu, 24 Aug 2017 22:02:47 +0000 (00:02 +0200)]
conf: do not check union on wrong net type

This will obviously not work.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: refactor network deletion
Christian Brauner [Thu, 24 Aug 2017 14:10:30 +0000 (16:10 +0200)]
conf: refactor network deletion

I'm ashamed at how aweful my previous code was.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoopenvswitch: delete ports intelligently
Christian Brauner [Thu, 24 Aug 2017 13:31:38 +0000 (15:31 +0200)]
openvswitch: delete ports intelligently

So far, when creating veth devices attached to openvswitch bridges we used to
fork() off a thread on container startup. This thread was kept around until the
container shut down. I have no good explanation why we did it that why but it's
certainly not necessary. Instead, let's fork() off the thread on container
shutdown to delete the veth.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: log lxc-user-nic output
Christian Brauner [Thu, 24 Aug 2017 11:43:15 +0000 (13:43 +0200)]
conf: log lxc-user-nic output

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: non-functional changes
Christian Brauner [Thu, 24 Aug 2017 11:26:10 +0000 (13:26 +0200)]
conf: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-user-nic: non-functional changes
Christian Brauner [Thu, 24 Aug 2017 10:57:18 +0000 (12:57 +0200)]
lxc-user-nic: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: non-functional changes
Christian Brauner [Wed, 23 Aug 2017 22:33:53 +0000 (00:33 +0200)]
network: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: log cleanup thread pid for openswitch
Christian Brauner [Wed, 23 Aug 2017 20:10:21 +0000 (22:10 +0200)]
network: log cleanup thread pid for openswitch

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotests: add tests for lxc.cgroup.dir
Christian Brauner [Wed, 23 Aug 2017 23:18:36 +0000 (01:18 +0200)]
tests: add tests for lxc.cgroup.dir

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: add "lxc.cgroup.dir"
Christian Brauner [Wed, 23 Aug 2017 13:03:01 +0000 (15:03 +0200)]
confile: add "lxc.cgroup.dir"

"lxc.cgroup.dir" can be used to set the name of the directory the container's
cgroup will be created in. For example, setting

    lxc.uts.name = c1
    lxc.cgroup.dir = lxd

would make liblxc create the cgroup

    lxd/c1

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1758 from carnil/master
Serge Hallyn [Thu, 24 Aug 2017 16:46:34 +0000 (11:46 -0500)]
Merge pull request #1758 from carnil/master

Use deb.debian.org as the default Debian mirror

6 years agoUse deb.debian.org as the default Debian mirror
Salvatore Bonaccorso [Thu, 24 Aug 2017 07:24:29 +0000 (09:24 +0200)]
Use deb.debian.org as the default Debian mirror

The httpredir.debian.org service has been discontinued in favour of
deb.debian.org and httpredir.debian.org now redirects to deb.debian.org.

https://lists.debian.org/debian-mirrors/2017/02/msg00000.html
https://wiki.debian.org/DebianGeoMirror#httpredir.debian.org_.2F_http.debian.net

Cf. https://bugs.debian.org/872719

Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
6 years agocgroups: non-functional changes
Christian Brauner [Wed, 23 Aug 2017 23:32:32 +0000 (01:32 +0200)]
cgroups: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: non-functional fixup
Christian Brauner [Wed, 23 Aug 2017 11:08:02 +0000 (13:08 +0200)]
conf: non-functional fixup

Surfaced while building lxc-2.0.8 on e2k architecture with lcc,
looks like its -Wall is more pedantic than gcc's:

lcc: "conf.c", line 1514: error: unrecognized character escape sequence
          [-Werror]
        DEBUG("created directory for console and tty devices at \%s\"", path);
                                                                ^
 in expansion of macro "DEBUG" at line 1514

Another byte is a leading whitespace fix while at that.

Signed-off-by: Michael Shigorin <mike@altlinux.org>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotree-wide: non-functional changes
Christian Brauner [Wed, 23 Aug 2017 08:58:22 +0000 (10:58 +0200)]
tree-wide: non-functional changes

- replace all "//" with "/* */"

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1756 from brauner/2017-08-10/further_lxc_2.1_preparations
Serge Hallyn [Tue, 22 Aug 2017 19:42:31 +0000 (14:42 -0500)]
Merge pull request #1756 from brauner/2017-08-10/further_lxc_2.1_preparations

further lxc 2.1 preparations

6 years agotools: add additional cgroup checks
Christian Brauner [Tue, 22 Aug 2017 12:22:21 +0000 (14:22 +0200)]
tools: add additional cgroup checks

- list all cgroup v1 mountpoints
- list all cgroup v2 mountpoints
- report "missing" when no mountpoint for the systemd controller was found
- report "missing" when no mountpoint for the freezer controller was found

Closes https://github.com/lxc/lxd/issues/3687.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: non-functional changes
Christian Brauner [Tue, 22 Aug 2017 10:43:18 +0000 (12:43 +0200)]
confile: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: non-functional changes
Christian Brauner [Tue, 22 Aug 2017 10:15:03 +0000 (12:15 +0200)]
confile: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: non-functional changes
Christian Brauner [Tue, 22 Aug 2017 10:05:37 +0000 (12:05 +0200)]
confile: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: non-functional changes
Christian Brauner [Tue, 22 Aug 2017 09:53:29 +0000 (11:53 +0200)]
confile: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1755 from brauner/2017-08-10/further_lxc_2.1_preparations
Stéphane Graber [Mon, 21 Aug 2017 22:36:56 +0000 (18:36 -0400)]
Merge pull request #1755 from brauner/2017-08-10/further_lxc_2.1_preparations

templates: remove legacy key from busybox

6 years agotemplates: remove legacy key from busybox
Christian Brauner [Mon, 21 Aug 2017 22:02:28 +0000 (00:02 +0200)]
templates: remove legacy key from busybox

lxc.rebootsignal -> lxc.signal.reboot

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1750 from brauner/2017-08-10/further_lxc_2.1_preparations
Serge Hallyn [Mon, 21 Aug 2017 19:46:00 +0000 (14:46 -0500)]
Merge pull request #1750 from brauner/2017-08-10/further_lxc_2.1_preparations

further lxc 2.1. preparations

6 years agoconf{,ile}: warn user once about legacy config
Christian Brauner [Mon, 21 Aug 2017 16:06:20 +0000 (18:06 +0200)]
conf{,ile}: warn user once about legacy config

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools: use "which"
Christian Brauner [Mon, 21 Aug 2017 15:33:30 +0000 (17:33 +0200)]
tools: use "which"

Somehow "type" doesn't really work.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools: add lxc-update-config.in
Christian Brauner [Wed, 16 Aug 2017 23:37:18 +0000 (01:37 +0200)]
tools: add lxc-update-config.in

This tool can be used to switch from a pre 2.1 to a 2.1 config file.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: lxc.id_map --> lxc.idmap
Christian Brauner [Mon, 21 Aug 2017 15:03:20 +0000 (17:03 +0200)]
confile: lxc.id_map --> lxc.idmap

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1752 from stgraber/master
Christian Brauner [Sun, 20 Aug 2017 11:54:51 +0000 (13:54 +0200)]
Merge pull request #1752 from stgraber/master

Add CONFIG_NETFILTER_XT_MATCH_COMMENT to lxc-checkconfig

6 years agoAdd CONFIG_NETFILTER_XT_MATCH_COMMENT to lxc-checkconfig
Stéphane Graber [Sat, 19 Aug 2017 16:28:46 +0000 (12:28 -0400)]
Add CONFIG_NETFILTER_XT_MATCH_COMMENT to lxc-checkconfig

Closes https://github.com/lxc/lxd/issues/3685

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
6 years agotest: add test to get subkeys
Christian Brauner [Tue, 15 Aug 2017 23:51:31 +0000 (01:51 +0200)]
test: add test to get subkeys

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: list namespaced keys
Christian Brauner [Tue, 15 Aug 2017 23:24:20 +0000 (01:24 +0200)]
confile: list namespaced keys

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: lxc_getconfig() -> lxc_get_config()
Christian Brauner [Tue, 15 Aug 2017 23:05:06 +0000 (01:05 +0200)]
confile: lxc_getconfig() -> lxc_get_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1746 from brauner/2017-08-10/further_lxc_2.1_preparations
Stéphane Graber [Tue, 15 Aug 2017 20:55:33 +0000 (16:55 -0400)]
Merge pull request #1746 from brauner/2017-08-10/further_lxc_2.1_preparations

further lxc 2.1 preparations

6 years agoconfile: improve get_network_config_ops()
Christian Brauner [Tue, 15 Aug 2017 20:10:24 +0000 (22:10 +0200)]
confile: improve get_network_config_ops()

- handle lxc.net.<idx> keys without any subkey
- allow caller to pass NULL if caller doesn't need to retrieve deindexed key

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostorage: add overlay as valid backend
Christian Brauner [Tue, 15 Aug 2017 18:02:45 +0000 (20:02 +0200)]
storage: add overlay as valid backend

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1739 from keloyang/mem-leak
Serge Hallyn [Sat, 12 Aug 2017 14:55:40 +0000 (09:55 -0500)]
Merge pull request #1739 from keloyang/mem-leak

Fix mem leak with realpath

6 years agoRevert "debian: jessie and stretch keyring support"
Stéphane Graber [Fri, 11 Aug 2017 19:06:02 +0000 (15:06 -0400)]
Revert "debian: jessie and stretch keyring support"

This reverts commit 87eacd4d49033d38d7e3257046079a77fd60e588.

While that commit looks right, the actual signing key doesn't match and
debootstrap therefore fails to bootstrap, as can be seen here:

https://jenkins.linuxcontainers.org/view/All/job/lxc-template-debian/

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
6 years agoFix mem leak with realpath
Shukui Yang [Fri, 11 Aug 2017 09:12:24 +0000 (17:12 +0800)]
Fix mem leak with realpath

Signed-off-by: Shukui Yang <yangshukui@huawei.com>
6 years agoconfile: move lxc_list_net()
Christian Brauner [Thu, 10 Aug 2017 22:30:09 +0000 (00:30 +0200)]
confile: move lxc_list_net()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: lxc_listconfigs -> lxc_list_config_items
Christian Brauner [Thu, 10 Aug 2017 22:19:10 +0000 (00:19 +0200)]
confile: lxc_listconfigs -> lxc_list_config_items

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: non-functional changes
Christian Brauner [Thu, 10 Aug 2017 22:13:25 +0000 (00:13 +0200)]
confile: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: rework lxc_list_net()
Christian Brauner [Thu, 10 Aug 2017 22:11:34 +0000 (00:11 +0200)]
confile: rework lxc_list_net()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: non-functional changes
Christian Brauner [Thu, 10 Aug 2017 21:48:59 +0000 (23:48 +0200)]
confile: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: cleanup
Christian Brauner [Thu, 10 Aug 2017 21:42:41 +0000 (23:42 +0200)]
confile: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1738 from brauner/2017-08-10/fix_android
Stéphane Graber [Thu, 10 Aug 2017 21:41:18 +0000 (17:41 -0400)]
Merge pull request #1738 from brauner/2017-08-10/fix_android

android: fix includes

6 years agoandroid: fix includes
Christian Brauner [Thu, 10 Aug 2017 21:00:12 +0000 (23:00 +0200)]
android: fix includes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1736 from brauner/2017-08-08/fix_gcc_warnings
Stéphane Graber [Thu, 10 Aug 2017 19:06:26 +0000 (15:06 -0400)]
Merge pull request #1736 from brauner/2017-08-08/fix_gcc_warnings

cgfsng: do not use uninitialized variable

6 years agolxccontainer: remove 5s timeout
Christian Brauner [Tue, 8 Aug 2017 19:48:48 +0000 (21:48 +0200)]
lxccontainer: remove 5s timeout

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: do not use uninitialized variable
Christian Brauner [Tue, 8 Aug 2017 18:35:43 +0000 (20:35 +0200)]
cgfsng: do not use uninitialized variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1735 from fanyeren/patch-20
Christian Brauner [Tue, 8 Aug 2017 14:48:11 +0000 (10:48 -0400)]
Merge pull request #1735 from fanyeren/patch-20

debian: jessie and stretch keyring support

6 years agodebian: jessie and stretch keyring support
有张纸 [Tue, 8 Aug 2017 10:06:38 +0000 (18:06 +0800)]
debian: jessie and stretch keyring support

Signed-off-by: feng xiahou xiahoufeng@yahoo.com
6 years agodebian: Add buster as a valid release
Stéphane Graber [Mon, 7 Aug 2017 21:49:40 +0000 (17:49 -0400)]
debian: Add buster as a valid release

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
6 years agoMerge pull request #1729 from brauner/2017-08-03/ensure_cgroup_cleanup_before_restart
Serge Hallyn [Sat, 5 Aug 2017 03:15:40 +0000 (22:15 -0500)]
Merge pull request #1729 from brauner/2017-08-03/ensure_cgroup_cleanup_before_restart

start: ensure cgroups are cleaned up

6 years agostart: ensure cgroups are cleaned up
Christian Brauner [Thu, 3 Aug 2017 21:55:23 +0000 (23:55 +0200)]
start: ensure cgroups are cleaned up

When a container is marked as being in STOPPED state it is possible for another
thread to start it again even though not all cleanup operations for that
container have finished. This is not a problem for most things like sockets and
friends which are unique to the container. It is however a problem for cgroups
which are named after that container in that we cause our cgroup driver to
waste cpu cycles finding a new cgroup name.

Closes  #1726.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #1727 from brauner/2017-08-02/fix_travis
Stéphane Graber [Thu, 3 Aug 2017 02:12:36 +0000 (22:12 -0400)]
Merge pull request #1727 from brauner/2017-08-02/fix_travis

travis: fix builds

6 years agoMerge pull request #1705 from brauner/2017-07-15/fix_clone
Serge Hallyn [Wed, 2 Aug 2017 17:30:06 +0000 (12:30 -0500)]
Merge pull request #1705 from brauner/2017-07-15/fix_clone

storage: rework storage drivers