From 867cc7bd395b32a3516112127a04d41d9f1b15fc Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 23 Feb 2010 14:35:08 -0800 Subject: [PATCH] xenserver: In vif script, tolerate port existing when we (re)add it. 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 Signed-off-by: Ben Pfaff --- xenserver/etc_xensource_scripts_vif | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif index 4df1ac96..d27bc10d 100755 --- a/xenserver/etc_xensource_scripts_vif +++ b/xenserver/etc_xensource_scripts_vif @@ -97,7 +97,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 -- 2.30.2