X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=xenserver%2Fetc_xensource_scripts_vif;h=6905448fd7357f9ffe12647355b4e9190f045665;hb=f99cd6eed222152d9e6cfb3cc83cba5d02f3e160;hp=2fcf9d402b65a4ab2feaa62442b32a3e83cd3ed5;hpb=d65349ea28bb67a0062a9b4b60ff97538206373b;p=sliver-openvswitch.git diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif index 2fcf9d402..6905448fd 100755 --- a/xenserver/etc_xensource_scripts_vif +++ b/xenserver/etc_xensource_scripts_vif @@ -1,7 +1,17 @@ #!/bin/sh -# Copyright (C) 2008,2009 Citrix Systems, Inc. All rights reserved. +# Copyright (C) 2008,2009 Citrix Systems, Inc. # Copyright (C) 2009 Nicira Networks, Inc. +# +# 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. # CA-23900: Warning: when VIFs are added to windows guests with PV drivers the backend vif device is registered, # unregistered and then registered again. This causes the udev event to fire twice and this script runs twice. @@ -11,7 +21,6 @@ # Keep other-config/ keys in sync with device.ml:vif_udev_keys -cfg_mod="/usr/bin/ovs-cfg-mod" vsctl="/usr/bin/ovs-vsctl" dump_vif_details="/usr/share/vswitch/scripts/dump-vif-details" service="/sbin/service" @@ -71,13 +80,6 @@ add_to_bridge() fi logger -t scripts-vif "Adding ${vif} to ${bridge} with address ${address}" - local VLAN_ID=$($vsctl br-to-vlan $bridge) - local vid= - if [ "$VLAN_ID" -ne 0 ] ; then - bridge=$($vsctl br-to-parent $bridge) - vid="--add=vlan.${vif}.tag=${VLAN_ID}" - fi - ${IP} link set "${vif}" down || logger -t scripts-vif "Failed to ip link set ${vif} down" ${IP} link set "${vif}" arp off || logger -t scripts-vif "Failed to ip link set ${vif} arp off" ${IP} link set "${vif}" multicast off || logger -t scripts-vif "Failed to ip link set ${vif} multicast off" @@ -89,13 +91,7 @@ add_to_bridge() logger -t scripts-vif "Failed to retrieve vif details for vswitch" fi - $cfg_mod -F /etc/ovs-vswitchd.conf \ - --del-match="bridge.*.port=$vif" \ - --del-match="vlan.$vif.[!0-9]*" \ - --del-match="port.$vif.[!0-9]*" \ - --add="bridge.$bridge.port=$vif" \ - $vid $vif_details -c - $service vswitch reload + $vsctl add-port $bridge $vif $vif_details ${IP} link set "${vif}" up || logger -t scripts-vif "Failed to ip link set ${vif} up" } @@ -125,10 +121,6 @@ remove) xenstore-rm "${HOTPLUG}/hotplug" vif=vif${DOMID}.${DEVID} logger -t scripts-vif "${vif} has been removed" - $cfg_mod -vANY:console:emer -F /etc/ovs-vswitchd.conf \ - --del-match="bridge.*.port=${vif}" \ - --del-match="vlan.${vif}.[!0-9]*" \ - --del-match="port.${vif}.[!0-9]*" -c - $service vswitch reload + $vsctl del-port $bridge $vif ;; esac