- # /etc/xensource/scripts/vif needs to know where to add VIFs.
- if pif_is_vlan(pif):
- if not bridge:
- raise Error("Unbridged VLAN devices not implemented yet")
- cfgmod_argv += ['--add=vlan.%s.tag=%s' % (ipdev, pifrec['VLAN'])]
- cfgmod_argv += ['--add=iface.%s.internal=true' % (ipdev)]
- cfgmod_argv += ['--add=iface.%s.fake-bridge=true' % (ipdev)]
- if not os.path.exists(vswitch_state_dir):
- os.mkdir(vswitch_state_dir)
- br = ConfigurationFile("br-%s" % ipdev, vswitch_state_dir)
- br.write("VLAN_SLAVE=%s\n" % bridge)
- br.write("VLAN_VID=%s\n" % pifrec['VLAN'])
- br.close()
- f.attach_child(br)
- else:
- br = ConfigurationFile("br-%s" % ipdev, vswitch_state_dir)
- br.unlink()
- f.attach_child(br)
-