~serge-hallyn/ubuntu/natty/lxc/fix-restart

« back to all changes in this revision

Viewing changes to debian/patches/0004-restore-lxc.mount-lxc.mount.entry-functionality.patch

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-01-23 17:28:55 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20110123172855-1vpaxel9kwocx7qz
Tags: 0.7.3.1-0ubuntu1
* Base on new upstream git tree with new maverick and natty templates,
  and able to run without ns cgroup.
* Send a 'container=lxc' variable to upstart.  The upstream git has
  the same patch, though this tree has it as a quilt patch.
* Add lxcguest package which converts a system into one which can
  boot upstart both as a container and a (kvm or bare-metal) host.
* Add a MIRROR default in /etc/default/lxc, and use that in the
  debootstrap command in the lucid, maverick and natty templates.
* Remove 0004-restore-lxc.mount-lxc.mount.entry-functionality.patch
  which prevents containers from starting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Rainer Weikusat <rweikusat@mssgmbh.com>
2
 
Date: Mon, 6 Dec 2010 16:33:43 +0100
3
 
Subject: [PATCH] restore lxc.mount/lxc.mount.entry functionality
4
 
 
5
 
The lxc_setup-routine in conf.c tries to configure the filesystem
6
 
namespace for a new container by first recursively bind-mounting the
7
 
directory which is supposed to become the root filesystem of the
8
 
container to the 'rootfs mount point' and then adding whatever other
9
 
mounts have been requested in the configuration file being used to the
10
 
original filesystem location of the nascent container root
11
 
filesystem. At least for Linux 2.6.35.7 (and .4), this doesn't work
12
 
because the MS_REC flag only affects submounts which already existed
13
 
at the time of the bind mount, not new ones which come into existence
14
 
afterwards. The patch moves the setup_rootfs call in lxc_setup behind
15
 
the two 'setup additional mounts' calls which fixes this problem (at
16
 
least for me).
17
 
 
18
 
Signed-off-by: Rainer Weikusat <rweikusat@mssgmbh.com>
19
 
Signed-off-by: Guido Trotter <ultrotter@debian.org>
20
 
---
21
 
 src/lxc/conf.c |   10 +++++-----
22
 
 1 files changed, 5 insertions(+), 5 deletions(-)
23
 
 
24
 
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
25
 
index e4e4bb5..20a843c 100644
26
 
--- a/src/lxc/conf.c
27
 
+++ b/src/lxc/conf.c
28
 
@@ -1597,11 +1597,6 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
29
 
                return -1;
30
 
        }
31
 
 
32
 
-       if (setup_rootfs(&lxc_conf->rootfs)) {
33
 
-               ERROR("failed to setup rootfs for '%s'", name);
34
 
-               return -1;
35
 
-       }
36
 
-
37
 
        if (setup_mount(lxc_conf->fstab)) {
38
 
                ERROR("failed to setup the mounts for '%s'", name);
39
 
                return -1;
40
 
@@ -1612,6 +1607,11 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
41
 
                return -1;
42
 
        }
43
 
 
44
 
+       if (setup_rootfs(&lxc_conf->rootfs)) {
45
 
+               ERROR("failed to setup rootfs for '%s'", name);
46
 
+               return -1;
47
 
+       }
48
 
+
49
 
        if (setup_cgroup(name, &lxc_conf->cgroup)) {
50
 
                ERROR("failed to setup the cgroups for '%s'", name);
51
 
                return -1;