[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH 2 of 7] [PATCH] xenserver: In vif script, tolerate port existing when we (re)add it



# HG changeset patch
# User Ben Pfaff <blp@xxxxxxxxxx>
# Date 1278595820 -3600
# Node ID bb3a7296251f5d6aabcaaf30e7c3c15c45c2eb90
# Parent  e778c60f347554f7e3295a7c3d7a1618e36626aa
[PATCH] xenserver: In vif script, tolerate port existing when we (re)add it.

>From 867cc7bd395b32a3516112127a04d41d9f1b15fc Mon Sep 17 00:00:00 2001
Date: Tue, 23 Feb 2010 14:35:08 -0800
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@xxxxxxxxxx>
Signed-off-by: Ben Pfaff <blp@xxxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 scripts/vif |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff -r e778c60f3475 -r bb3a7296251f scripts/vif
--- a/scripts/vif       Thu Jul 08 14:30:18 2010 +0100
+++ b/scripts/vif       Thu Jul 08 14:30:20 2010 +0100
@@ -97,7 +97,7 @@
                        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
            
 scripts/vif |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Attachment: txtXbxnzeVyWb.txt
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.