public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Serge Hallyn <serge.hallyn@ubuntu.com>
To: Libo Chen <clbchenlibo.chen@huawei.com>
Cc: containers@lists.linux-foundation.org,
	LKML <linux-kernel@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Subject: Re: Q: use vlan in container
Date: Fri, 29 Nov 2013 08:18:26 -0600	[thread overview]
Message-ID: <20131129141826.GA5018@sergelap> (raw)
In-Reply-To: <529836CD.1080900@huawei.com>

Quoting Libo Chen (clbchenlibo.chen@huawei.com):
> On 2013/11/29 13:05, Serge Hallyn wrote:
> > Quoting Libo Chen (clbchenlibo.chen@huawei.com):
> >> Hello LXC experts,
> >>
> >> 	I meet a problem. When using vlan as network device in suse11 system container,
> >> I can not use halt to stop this container. It hung on "eth0 is still used from interfaces eth0" in cycle.
> >>
> >> The config file:
> >>
> >> lxc.network.type = vlan
> >> lxc.network.flags = up
> >> lxc.network.link = eth0
> >> lxc.network.name = eth0
> >> lxc.network.vlan.id = 1301
> >> lxc.network.ipv4 = 128.5.131.100/24
> >>
> >>
> >> The reason is in the shell command /sbin/ifdown, see below:
> >>
> >> ######################################################################
> >> # Shut down depending interfaces
> >> #
> >> # Check if there are interfaces which depend on this interface. If yes these
> >> # have to be shut down first.
> >> # For example these might be bonding or vlan interfaces. Note that we don't
> >> # catch all types of depending interfaces currently. See function
> >> # 'get_depending_ifaces' in file 'functions' for details.
> >> #
> >> test "$SCRIPTNAME" = ifdown && DEP_IFACES=`get_depending_ifaces $INTERFACE`
> >> if [ "$?" = 0 -a "$NODEPS" != yes ] ; then
> >>         message "`printf "    %-9s is still used from interfaces %s" \
> >>                          $INTERFACE "$DEP_IFACES"`"
> >>         for DI in $DEP_IFACES; do
> > 
> > Should the proper fix be to fix this script so that it doesn't call
> > ifdown recursively if $DI = $INTERFACE ?
> 
> Hi Serge,
> 
> yes, I had try this way before as below:
> 
>         for DI in $DEP_IFACES; do
> 	         if [ "$DI" != "$INTERFACE" ] ; then
>                        ifdown $DI -o $OPTIONS
> 	         fi
>         done
> 
> It works well, but I have no idea it is safe enough and no side effects?

It's safe enough and should have no side effects itself.  But
I recommend you first look up how get_depending_ifaces() is
implemented.  That's where this really should be fixed, and if
it turns out that the proper fix for *that* is in the kernel
then that's ok.

-serge

  reply	other threads:[~2013-11-29 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28  6:17 Q: use vlan in container Libo Chen
2013-11-29  5:05 ` Serge Hallyn
2013-11-29  6:40   ` Libo Chen
2013-11-29 14:18     ` Serge Hallyn [this message]
2013-11-30  1:46       ` Libo Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131129141826.GA5018@sergelap \
    --to=serge.hallyn@ubuntu.com \
    --cc=clbchenlibo.chen@huawei.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jovi.zhangwei@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox