[lxc-devel] [lxc/master] Patch from Harald Dunkel + tweak
stgraber on Github
lxc-bot at linuxcontainers.org
Tue Mar 14 12:45:34 UTC 2017
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170314/987e8bdb/attachment.bin>
-------------- next part --------------
From 8fc698019cfb7bea47fae5cbfb4af8b44f4a7f52 Mon Sep 17 00:00:00 2001
From: Harald Dunkel <harald.dunkel at aixigo.de>
Date: Tue, 14 Mar 2017 12:42:15 +0000
Subject: [PATCH 1/2] Fix lxc-containers to support multiple bridges
Signed-off-by: Harald Dunkel <harald.dunkel at aixigo.de>
---
config/init/common/lxc-containers.in | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/config/init/common/lxc-containers.in b/config/init/common/lxc-containers.in
index ebce36e..ef5a80b 100644
--- a/config/init/common/lxc-containers.in
+++ b/config/init/common/lxc-containers.in
@@ -51,7 +51,7 @@ fi
# to start
wait_for_bridge()
{
- local BRNAME try flags
+ local BRNAME try flags br
[ -f "$sysconfdir"/lxc/default.conf ] || { return 0; }
BRNAME=`grep '^[ ]*lxc.network.link' "$sysconfdir"/lxc/default.conf | sed 's/^.*=[ ]*//'`
@@ -60,11 +60,12 @@ wait_for_bridge()
fi
for try in `seq 1 30`; do
- if [ -r /sys/class/net/$BRNAME/flags ]; then
- read flags < /sys/class/net/$BRNAME/flags
- [ $((flags & 0x1)) -eq 1 ] && { return 0; }
- fi
- sleep 1
+ for br in ${BRNAME}; do
+ [ -r /sys/class/net/${br}/flags ] || { sleep 1; continue 2; }
+ read flags < /sys/class/net/${br}/flags
+ [ $((flags & 0x1)) -eq 1 ] || { sleep 1; continue 2; }
+ done
+ return 0
done
}
From bd657b44e9fef20577893646dd372fa244b938db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 14 Mar 2017 12:44:35 +0000
Subject: [PATCH 2/2] Fix mixed tab/spaces in previous patch
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
config/init/common/lxc-containers.in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/config/init/common/lxc-containers.in b/config/init/common/lxc-containers.in
index ef5a80b..5becccd 100644
--- a/config/init/common/lxc-containers.in
+++ b/config/init/common/lxc-containers.in
@@ -60,12 +60,12 @@ wait_for_bridge()
fi
for try in `seq 1 30`; do
- for br in ${BRNAME}; do
- [ -r /sys/class/net/${br}/flags ] || { sleep 1; continue 2; }
- read flags < /sys/class/net/${br}/flags
- [ $((flags & 0x1)) -eq 1 ] || { sleep 1; continue 2; }
- done
- return 0
+ for br in ${BRNAME}; do
+ [ -r /sys/class/net/${br}/flags ] || { sleep 1; continue 2; }
+ read flags < /sys/class/net/${br}/flags
+ [ $((flags & 0x1)) -eq 1 ] || { sleep 1; continue 2; }
+ done
+ return 0
done
}
More information about the lxc-devel
mailing list