[ovs-dev] [PATCH 4/4] xenserver: In vif script, tolerate port existing when we (re)add it.

Ben Pfaff blp at nicira.com
Tue Feb 23 14:36:01 PST 2010


When a Windows VM boots, it initially has "vif" devices.  Then, when
XS Tools loads during boot, those "vif" devices disappear and then are
recreated under the same name.  The vif script is not called to remove
the old devices, but it is called to add the new ones.  It refused to do
this, however, because it saw the new device as having a duplicate name
(because the old was wasn't deleted).

This commit fixes the problem by making the vif script delete the port,
if it exists, before it adds it.

Bug #2425.

CC: Ian Campbell <ian.campbell at citrix.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 xenserver/etc_xensource_scripts_vif |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif
index 1fbf155..f7b640b 100755
--- a/xenserver/etc_xensource_scripts_vif
+++ b/xenserver/etc_xensource_scripts_vif
@@ -96,7 +96,7 @@ add_to_bridge()
 			logger -t scripts-vif "Failed to retrieve vif details for vswitch"
 		fi
 
-		$vsctl add-port $bridge $dev $vif_details
+		$vsctl -- --if-exists del-port $dev -- add-port $bridge $dev $vif_details
 	    ;;
     esac
 	    
-- 
1.6.6.1





More information about the dev mailing list