X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xenserver%2Fopt_xensource_libexec_interface-reconfigure;h=74f06f8c52d3b1e74f3f4bce2508690ca348a81a;hb=e86c8696eb0bc62f4a4ae45df5715cee73533408;hp=6ea369ffbbc3017d743cc839627abf3c1d9aee9b;hpb=064af42167bf4fc9aaea2702d80ce08074b889c0;p=openvswitch diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure index 6ea369ff..74f06f8c 100755 --- a/xenserver/opt_xensource_libexec_interface-reconfigure +++ b/xenserver/opt_xensource_libexec_interface-reconfigure @@ -69,7 +69,7 @@ output_directory = None db = None management_pif = None -dbcache_file = "/etc/vswitch.dbcache" +dbcache_file = "/etc/ovs-vswitch.dbcache" vswitch_config_dir = "/etc/openvswitch" class Usage(Exception): @@ -786,6 +786,10 @@ def action_up(pif): bond_master = pif else: bond_master = None + if bond_master: + bond_slaves = get_bond_slaves_of_pif(bond_master) + else: + bond_slaves = [] bond_masters = get_bond_masters_of_pif(pif) # Support "rpm -e vswitch" gracefully by keeping Centos configuration @@ -872,6 +876,16 @@ def action_up(pif): net = db.get_pif_record(nwpif)['network'] network_uuids += [db.get_network_record(net)['uuid']] + # Bring up bond slaves early, because ovs-vswitchd initially + # enables or disables bond slaves based on whether carrier is + # detected when they are added, and a network device that is down + # always reports "no carrier". + bond_slave_physdevs = [] + for slave in bond_slaves: + bond_slave_physdevs += physdev_names(slave) + for slave_physdev in bond_slave_physdevs: + up_netdev(slave_physdev) + # Now modify the ovs-vswitchd config file. argv = [] for port in set(del_ports): @@ -906,10 +920,11 @@ def action_up(pif): # Configure network devices. configure_netdev(pif) - # Bring up VLAN slave and bond slaves. + # Bring up VLAN slave, plus physical devices other than bond + # slaves (which we brought up earlier). if vlan_slave: up_netdev(ipdev_name(vlan_slave)) - for physdev in physdevs: + for physdev in set(physdevs) - set(bond_slave_physdevs): up_netdev(physdev) # Update /etc/issue (which contains the IP address of the management interface)