[ovs-dev] [PATCH 4/5] xenserver: Prepend XenServer external ids with "xs-"

Justin Pettit jpettit at nicira.com
Wed Aug 25 23:10:22 UTC 2010


---
 tests/interface-reconfigure.at                     |   12 ++++++------
 vswitchd/vswitch.xml                               |    2 +-
 xenserver/README                                   |    4 ++--
 xenserver/automake.mk                              |    2 +-
 xenserver/etc_init.d_openvswitch                   |    2 +-
 xenserver/etc_xensource_scripts_vif                |   12 ++++++------
 xenserver/openvswitch-xen.spec                     |   10 +++++-----
 ...ensource_libexec_InterfaceReconfigureVswitch.py |    4 ++--
 ...e_openvswitch_scripts_refresh-xs-network-uuids} |    0
 9 files changed, 24 insertions(+), 24 deletions(-)
 rename xenserver/{usr_share_openvswitch_scripts_refresh-network-uuids => usr_share_openvswitch_scripts_refresh-xs-network-uuids} (100%)

diff --git a/tests/interface-reconfigure.at b/tests/interface-reconfigure.at
index 69f9830..880f4a5 100644
--- a/tests/interface-reconfigure.at
+++ b/tests/interface-reconfigure.at
@@ -654,7 +654,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration
     --may-exist add-br xenbr2
     --may-exist add-port xenbr2 eth2
     set Bridge xenbr2 other-config:hwaddr="00:15:17:a0:29:80"
-    br-set-external-id xenbr2 network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99
+    br-set-external-id xenbr2 xs-network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99
 /sbin/ifup xenbr2
 /sbin/update-issue
 Committing changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration
@@ -717,10 +717,10 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration
     --may-exist add-br xenbr3
     --may-exist add-port xenbr3 eth3
     set Bridge xenbr3 other-config:hwaddr="00:15:17:a0:29:81"
-    br-set-external-id xenbr3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
+    br-set-external-id xenbr3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
     --if-exists del-br xapi3
     --may-exist add-br xapi3 xenbr3 123
-    br-set-external-id xapi3 network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
+    br-set-external-id xapi3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6
     set Interface xapi3 MAC="00:15:17:a0:29:81"
 /sbin/ifup xapi3
 /sbin/update-issue
@@ -802,7 +802,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration
     --fake-iface add-bond xapi1 bond0 eth0 eth1
     set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000
     set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
-    br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
+    br-set-external-id xapi1 xs-network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
 /sbin/ifup xapi1
 action_up: bring up bond0
 /sbin/ifconfig bond0 up
@@ -883,10 +883,10 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration
     --fake-iface add-bond xapi1 bond0 eth0 eth1
     set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:"bond-miimon"=100 other-config:"bond-use_carrier"=1 other-config:"bond-mode"="balance-slb" bond_updelay=31000
     set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
-    br-set-external-id xapi1 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
+    br-set-external-id xapi1 xs-network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
     --if-exists del-br xapi2
     --may-exist add-br xapi2 xapi1 4
-    br-set-external-id xapi2 network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
+    br-set-external-id xapi2 xs-network-uuids 99be2da4-6c33-6f8e-49ea-3bc592fe3c85;45cbbb43-113d-a712-3231-c6463f253cef
     set Interface xapi2 MAC="00:22:19:22:4b:af"
 /sbin/ifup xapi2
 action_up: bring up bond0
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index a415e76..7c510eb 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -363,7 +363,7 @@
           column), external IDs for the fake bridge are defined here by
           prefixing a <ref table="Bridge"/> <ref table="Bridge"
           column="external_ids"/> key with <code>fake-bridge-</code>,
-          e.g. <code>fake-bridge-network-uuids</code>.
+          e.g. <code>fake-bridge-xs-network-uuids</code>.
         </p>
       </column>
 
diff --git a/xenserver/README b/xenserver/README
index 3b7809f..db2bd29 100644
--- a/xenserver/README
+++ b/xenserver/README
@@ -49,9 +49,9 @@ files are:
 
         Open vSwitch-aware replacement for Citrix script of the same name.
 
-    usr_share_openvswitch_scripts_refresh-network-uuids
+    usr_share_openvswitch_scripts_refresh-xs-network-uuids
 
-        Script to refresh Bridge table external-ids:network-uuids
+        Script to refresh Bridge table external-ids:xs-network-uuids
         values, which can get out-of-sync following a pool join.
 
     usr_share_openvswitch_scripts_sysconfig.template
diff --git a/xenserver/automake.mk b/xenserver/automake.mk
index b16fef9..fa5b466 100644
--- a/xenserver/automake.mk
+++ b/xenserver/automake.mk
@@ -23,6 +23,6 @@ EXTRA_DIST += \
 	xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
 	xenserver/usr_sbin_brctl \
 	xenserver/usr_sbin_xen-bugtool \
-	xenserver/usr_share_openvswitch_scripts_refresh-network-uuids \
+	xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids \
 	xenserver/usr_share_openvswitch_scripts_sysconfig.template \
 	xenserver/uuid.py
diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index cad6bf5..850a7ed 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -295,7 +295,7 @@ function set_system_ids {
         action "Configuring Open vSwitch system IDs" true
         $vsctl --no-wait set Open_vSwitch . external-ids:system-type="$PRODUCT_BRAND"
         $vsctl --no-wait set Open_vSwitch . external-ids:system-version="$PRODUCT_VERSION-$BUILD_NUMBER"
-        $vsctl --no-wait set Open_vSwitch . external-ids:system-uuid="$INSTALLATION_UUID"
+        $vsctl --no-wait set Open_vSwitch . external-ids:xs-system-uuid="$INSTALLATION_UUID"
     else
         action "Configuring Open vSwitch system IDs" false
     fi
diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif
index fe85205..91b75c1 100755
--- a/xenserver/etc_xensource_scripts_vif
+++ b/xenserver/etc_xensource_scripts_vif
@@ -92,7 +92,7 @@ handle_vswitch_vif_details()
         local vm_uuid=$(xenstore-read "$vm/uuid" 2>/dev/null)
     fi
     if [ -n "${vm_uuid}" ] ; then
-        set_vif_external_id "vm-uuid" "${vm_uuid}"
+        set_vif_external_id "xs-vm-uuid" "${vm_uuid}"
     fi
 
     local vif_uuid=$(xenstore-read "${PRIVATE}/vif-uuid" 2>/dev/null)
@@ -100,7 +100,7 @@ handle_vswitch_vif_details()
         vif_uuid=$(xe vif-list --minimal vm-uuid="${vm_uuid}" device=$DEVID)
     fi
     if [ -n "${vif_uuid}" ] ; then
-        set_vif_external_id "vif-uuid" "${vif_uuid}"
+        set_vif_external_id "xs-vif-uuid" "${vif_uuid}"
     fi
 
     local vif_details=
@@ -109,12 +109,12 @@ handle_vswitch_vif_details()
         net_uuid=$(xe vif-param-get uuid="${vif_uuid}" param-name=network-uuid)
     fi
     if [ -n "${net_uuid}" ] ; then
-        set_vif_external_id "network-uuid" "${net_uuid}"
+        set_vif_external_id "xs-network-uuid" "${net_uuid}"
     fi
 
     local address=$(xenstore-read "/local/domain/$DOMID/device/vif/$DEVID/mac" 2>/dev/null)
     if [ -n "${address}" ] ; then
-        set_vif_external_id "vif-mac" "${address}"
+        set_vif_external_id "xs-vif-mac" "${address}"
     fi
 
     if $xs550; then
@@ -129,8 +129,8 @@ handle_vswitch_vif_details()
         # configuration variable, but vNetManager can tolerate that.
         local bridge=$1
         if [ -n "${net_uuid}" ] ; then
-            logger -t scripts-vif "${bridge} network-uuids ${net_uuid}"
-            echo "-- br-set-external-id $bridge network-uuids ${net_uuid}"
+            logger -t scripts-vif "${bridge} xs-network-uuids ${net_uuid}"
+            echo "-- br-set-external-id $bridge xs-network-uuids ${net_uuid}"
         fi
     fi
 }
diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec
index f693ea0..80dbec7 100644
--- a/xenserver/openvswitch-xen.spec
+++ b/xenserver/openvswitch-xen.spec
@@ -73,8 +73,8 @@ install -m 644 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py \
              $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/InterfaceReconfigureVswitch.py
 install -m 755 xenserver/etc_xensource_scripts_vif \
              $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/vif
-install -m 755 xenserver/usr_share_openvswitch_scripts_refresh-network-uuids \
-               $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/refresh-network-uuids
+install -m 755 xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids \
+               $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/refresh-xs-network-uuids
 install -m 755 xenserver/usr_sbin_xen-bugtool \
              $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/xen-bugtool
 install -m 755 xenserver/usr_sbin_brctl \
@@ -158,12 +158,12 @@ EOF
     fi
 fi
 
-# On XenServer 5.5.0, we need refresh-network-uuids to run whenever
+# On XenServer 5.5.0, we need refresh-xs-network-uuids to run whenever
 # XAPI starts or restarts.  (On XenServer 5.6.0, XAPI calls the
 # "update" method of the vswitch-cfg-update plugin whenever it starts
 # or restarts, so this is no longer necessary.)
 if test "$PRODUCT_VERSION" = "5.5.0"; then
-    RNU=/usr/share/openvswitch/scripts/refresh-network-uuids
+    RNU=/usr/share/openvswitch/scripts/refresh-xs-network-uuids
     XSS=/opt/xensource/libexec/xapi-startup-script
     if test -e $XSS && (test ! -L $XSS || test "`readlink $XSS`" != $RNU); then
         echo "$XSS is already in use, refusing to overwrite"
@@ -390,7 +390,7 @@ fi
 /usr/share/openvswitch/python/ovs/timeval.py
 /usr/share/openvswitch/python/ovs/util.py
 /usr/share/openvswitch/python/uuid.py
-/usr/share/openvswitch/scripts/refresh-network-uuids
+/usr/share/openvswitch/scripts/refresh-xs-network-uuids
 /usr/share/openvswitch/scripts/interface-reconfigure
 /usr/share/openvswitch/scripts/InterfaceReconfigure.py
 /usr/share/openvswitch/scripts/InterfaceReconfigureBridge.py
diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
index ef2f1fe..bc311f8 100644
--- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
+++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
@@ -345,9 +345,9 @@ def set_br_external_ids(pif):
         xs_network_uuids += [nwrec['uuid']]
 
     vsctl_argv = []
-    vsctl_argv += ['# configure network-uuids']
+    vsctl_argv += ['# configure xs-network-uuids']
     vsctl_argv += ['--', 'br-set-external-id', pif_bridge_name(pif),
-            'network-uuids', ';'.join(xs_network_uuids)]
+            'xs-network-uuids', ';'.join(xs_network_uuids)]
 
     return vsctl_argv
 
diff --git a/xenserver/usr_share_openvswitch_scripts_refresh-network-uuids b/xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids
similarity index 100%
rename from xenserver/usr_share_openvswitch_scripts_refresh-network-uuids
rename to xenserver/usr_share_openvswitch_scripts_refresh-xs-network-uuids
-- 
1.7.1





More information about the dev mailing list