Browse code

Update libcontainer to 84c1636580a356db88b079d118b

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Michael Crosby authored on 2014/11/21 07:19:24
Showing 4 changed files
... ...
@@ -66,7 +66,7 @@ if [ "$1" = '--go' ]; then
66 66
 	mv tmp-tar src/code.google.com/p/go/src/pkg/archive/tar
67 67
 fi
68 68
 
69
-clone git github.com/docker/libcontainer 28cb5f9dfd6f3352c610a4f1502b5df4f69389ea
69
+clone git github.com/docker/libcontainer 84c1636580a356db88b079d118b94abe6a1a0acd
70 70
 # see src/github.com/docker/libcontainer/update-vendor.sh which is the "source of truth" for libcontainer deps (just like this file)
71 71
 rm -rf src/github.com/docker/libcontainer/vendor
72 72
 eval "$(grep '^clone ' src/github.com/docker/libcontainer/update-vendor.sh | grep -v 'github.com/codegangsta/cli')"
... ...
@@ -14,17 +14,11 @@ type CpusetGroup struct {
14 14
 }
15 15
 
16 16
 func (s *CpusetGroup) Set(d *data) error {
17
-	// we don't want to join this cgroup unless it is specified
18
-	if d.c.CpusetCpus != "" {
19
-		dir, err := d.path("cpuset")
20
-		if err != nil {
21
-			return err
22
-		}
23
-
24
-		return s.SetDir(dir, d.c.CpusetCpus, d.pid)
17
+	dir, err := d.path("cpuset")
18
+	if err != nil {
19
+		return err
25 20
 	}
26
-
27
-	return nil
21
+	return s.SetDir(dir, d.c.CpusetCpus, d.pid)
28 22
 }
29 23
 
30 24
 func (s *CpusetGroup) Remove(d *data) error {
... ...
@@ -46,8 +40,12 @@ func (s *CpusetGroup) SetDir(dir, value string, pid int) error {
46 46
 		return err
47 47
 	}
48 48
 
49
-	if err := writeFile(dir, "cpuset.cpus", value); err != nil {
50
-		return err
49
+	// If we don't use --cpuset, the default cpuset.cpus is set in
50
+	// s.ensureParent, otherwise, use the value we set
51
+	if value != "" {
52
+		if err := writeFile(dir, "cpuset.cpus", value); err != nil {
53
+			return err
54
+		}
51 55
 	}
52 56
 
53 57
 	return nil
... ...
@@ -137,16 +137,14 @@ func Apply(c *cgroups.Cgroup, pid int) (map[string]string, error) {
137 137
 
138 138
 	}
139 139
 
140
-	// we need to manually join the freezer cgroup in systemd because it does not currently support it
141
-	// via the dbus api
140
+	// we need to manually join the freezer and cpuset cgroup in systemd
141
+	// because it does not currently support it via the dbus api.
142 142
 	if err := joinFreezer(c, pid); err != nil {
143 143
 		return nil, err
144 144
 	}
145 145
 
146
-	if c.CpusetCpus != "" {
147
-		if err := joinCpuset(c, pid); err != nil {
148
-			return nil, err
149
-		}
146
+	if err := joinCpuset(c, pid); err != nil {
147
+		return nil, err
150 148
 	}
151 149
 
152 150
 	paths := make(map[string]string)
... ...
@@ -39,9 +39,6 @@ func (v *Veth) Create(n *Network, nspid int, networkState *NetworkState) error {
39 39
 	if err := SetMtu(name1, n.Mtu); err != nil {
40 40
 		return err
41 41
 	}
42
-	if err := SetHairpinMode(name1, true); err != nil {
43
-		return err
44
-	}
45 42
 	if err := InterfaceUp(name1); err != nil {
46 43
 		return err
47 44
 	}