Make novlandev the default, but easily overridable for all guests.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Sat, 16 Sep 2006 14:21:00 +0000 (14:21 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Sat, 16 Sep 2006 14:21:00 +0000 (14:21 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2319 94cd875c-1c1d-0410-91d2-eb244daf1a30

doc/configuration.xml
scripts/vserver.functions

index 35d34aa..9556c6b 100644 (file)
@@ -191,6 +191,15 @@ operation will fail. Most tools assume 'on' as the default value.
 
       </collection>
     </collection>
+
+    <collection name="interfaces" use="optional">
+      <boolean id="global-vlandev" name="vlandev">
+       <description>
+When this file exists, the steps which setup and destroy a VLAN
+interface will be executed.
+       </description>
+      </boolean>
+    </collection>
   </collection>
     
   <collection name=".distributions" use="optional">
@@ -1128,6 +1137,20 @@ The fixed value of the current action (e.g. 'prepre-start', 'post-stop'...).
       <scalar name="scope">
        <description>The default scope of the network interfaces.</description>
       </scalar>
+      <boolean id="local-vlandev" name="vlandev">
+       <description>
+When this file exists, the steps which setup and destroy a VLAN
+interface will be executed for all interfaces of this vserver.
+       </description>
+      </boolean>
+      <boolean id="local-novlandev" name="novlandev">
+       <description>
+When this file exists, the steps which setup and destroy a VLAN
+interface will be skipped. This overrides the global
+<optionref ref="global-vlandev">vlandev</optionref> setting for
+this vserver.
+       </description>
+      </boolean>
       
       <collection name="iface" type="symbolic">
        <description>
@@ -1177,8 +1200,15 @@ created by the host or another vserver.
        <boolean name="novlandev">
          <description>
 When this file exists, the steps which setup and destroy a VLAN
-interface will be skipped. This flag should be set when a VLAN
-interface is used by multiple vservers or by the host.
+interface will be skipped. This will override the global
+<optionref ref="global-vlandev">vlandev</optionref> and the per-guest
+<optionref ref="local-vlandev">vlandev</optionref>.
+         </description>
+       </boolean>
+       <boolean name="vlandev">
+         <description>
+When this file exists, the steps which setup and destroy a VLAN
+interface will be executed.
          </description>
        </boolean>
       </collection>
index d57a783..752bd85 100644 (file)
@@ -533,7 +533,11 @@ function _processSingleInterface
                echo -e $"VLAN device-name used, but vlan subsystem not enabled.\nTry to execute 'modprobe 8021q' before starting the vservers"  >&2
                return 1
            }
-           test -f /proc/net/vlan -o -e "$iface"/novlandev || {
+           test -e "$iface/vlandev" \
+                -o \( -e "$iface/../vlandev" -a ! -e "$iface/novlandev" \) \
+                -o \( -e "$__CONFDIR/.defaults/interfaces/vlandev" \
+                      -a ! -e "$iface/novlandev" \
+                      -a ! -e "$iface/../novlandev" \) && {
                _addInterfaceCmd VCONFIG $vlan_info
            }
        fi