X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=xenserver%2Fopt_xensource_libexec_interface-reconfigure;h=2b6f62b46dd9ddf1be560ecbe73b5740e283e29b;hb=6bab37989b1b5e8981bee80e1fedef621799332c;hp=f29e75b9ca867dcd9c0544fa5f30448e36422048;hpb=0b8870d4a5135cadf2237307b30121075017cb6a;p=sliver-openvswitch.git diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure index f29e75b9c..2b6f62b46 100755 --- a/xenserver/opt_xensource_libexec_interface-reconfigure +++ b/xenserver/opt_xensource_libexec_interface-reconfigure @@ -1,8 +1,18 @@ #!/usr/bin/python # -# Copyright (c) 2008,2009 Citrix Systems, Inc. All rights reserved. +# Copyright (c) 2008,2009 Citrix Systems, Inc. # Copyright (c) 2009 Nicira Networks. # +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; version 2.1 only. with the special +# exception on linking described in file LICENSE. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# """Usage: %(command-name)s up @@ -1250,7 +1260,8 @@ def datapath_deconfigure_ipdev(interface): return ['--del-match=bridge.*.port=%s' % interface, '--del-match=port.%s.[!0-9]*' % interface, '--del-match=iface.%s.[!0-9]*' % interface, - '--del-match=vlan.%s.[!0-9]*' % interface] + '--del-match=vlan.%s.trunks=*' % interface, + '--del-match=vlan.%s.tag=*' % interface] def datapath_modify_config(commands): if debug_mode(): @@ -1448,9 +1459,13 @@ def action_up(pif): for nwpif in db.get_pifs_by_device(db.get_pif_record(pif)['device']): rec = db.get_pif_record(nwpif) - if nwpif != pif and not rec['currently_attached']: - log("Network PIF %s not currently attached (%s)" % (rec['uuid'],pifrec['uuid'])) - continue + + # When state is read from dbcache PIF.currently_attached + # is always assumed to be false... Err on the side of + # listing even detached networks for the time being. + #if nwpif != pif and not rec['currently_attached']: + # log("Network PIF %s not currently attached (%s)" % (rec['uuid'],pifrec['uuid'])) + # continue nwrec = db.get_network_record(rec['network']) cfgmod_argv += ['--add=bridge.%s.xs-network-uuids=%s' % (bridge, nwrec['uuid'])] @@ -1469,17 +1484,6 @@ def action_up(pif): 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) # Apply updated configuration. try: