WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 2 of 7] [PATCH] xenserver: In vif script, tolerate port

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 2 of 7] [PATCH] xenserver: In vif script, tolerate port existing when we (re)add it
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 8 Jul 2010 14:30:44 +0100
Delivery-date: Thu, 08 Jul 2010 06:42:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1278595842@ely>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1278595842@ely>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# 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: txtkA86SUaS4u.txt
Description: Text Data

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