xenserver: Report the system type and version as external ids
authorJustin Pettit <jpettit@nicira.com>
Thu, 5 Aug 2010 01:52:17 +0000 (18:52 -0700)
committerJustin Pettit <jpettit@nicira.com>
Wed, 25 Aug 2010 23:48:16 +0000 (16:48 -0700)
The configuration schema defines the system-type and system-version
external-ids for the Open_vSwitch table.  This commit adds support for
reporting them on XenServer.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
xenserver/etc_init.d_openvswitch

index c52864eb2da3eda2d76506a2d7ffaa4823fde60d..19d825b389926340a07b07cf463c47a1410b157f 100755 (executable)
@@ -290,12 +290,15 @@ EOF
     esac
 }
 
-function set_system_uuid {
-    if test -n "$INSTALLATION_UUID"; then
-        action "Configuring Open vSwitch system UUID" true
-        $vsctl --no-wait set Open_vSwitch . external-ids:system-uuid="$INSTALLATION_UUID"
+function set_system_ids {
+    if [ -f /etc/xensource-inventory ]; then
+        action "Configuring Open vSwitch system IDs" true
+        $vsctl --no-wait set Open_vSwitch . \
+            external-ids:system-type="$PRODUCT_BRAND" \
+            external-ids:system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \
+            external-ids:system-uuid="$INSTALLATION_UUID"
     else
-        action "Configuring Open vSwitch system UUID" false
+        action "Configuring Open vSwitch system IDs" false
     fi
 }
 
@@ -333,7 +336,7 @@ function start {
         done
     fi
 
-    set_system_uuid
+    set_system_ids
 
     start_vswitchd
     if [ "${ENABLE_BRCOMPAT}" = "y" ] ; then