<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">贺鹏</b> <span dir="ltr"><<a href="mailto:xnhp0320@gmail.com">xnhp0320@gmail.com</a>></span><br>Date: 2010/6/18<br>
Subject: Why real device can't move to container when sysfs is enabled?<br>To: <a href="mailto:Devel@openvz.org">Devel@openvz.org</a><br>Cc: <a href="mailto:User@openvz.org">User@openvz.org</a><br><br><br>I'm using the openvz kernel 2.6.32, and found that I can't netdev_add a real net device to a container.<br>
<br>I found the function<b> __dev_change_net_namespac</b>e in net/core/dev.c, and it says:<br><br><br>#ifdef CONFIG_SYSFS<br>
/* Don't allow real devices to be moved when sysfs<br> * is enabled.<br> */<br> err = -EINVAL;<br> if (dev->dev.parent)<br> goto out;<br>#endif<br><br><br>It seems if you enable CONFIG_SYSFS, you can't add a real device to a container with the netdev_add command.<br>
<br>I'm confused about this, because under kernel 2.6.18, it's ok to add a real device when sysfs is enabled.<br><br>Why forbid this?<br>and if I want to add a net device, How? <br><font color="#888888"><br><br>-- <br>
hepeng<br>ICT<br>
<br>
</font></div><br><br clear="all"><br>-- <br>hepeng<br>ICT<br>