From: Ben Pfaff Date: Mon, 27 Dec 2010 18:18:14 +0000 (-0800) Subject: vswitchd: Add OVS version to database, give system info its own columns. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=538c6dfab42ec72f916e80f916e858f988d1c48d;p=openvswitch vswitchd: Add OVS version to database, give system info its own columns. Until now, nothing in the database has reported the Open vSwitch version number. This commit adds that. In addition, this commits moves the system type and version from external-ids to individual columns, because we decided that these were important enough not to relegate them to a grab-bag field. --- diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema index 52573e51..04b691a5 100644 --- a/vswitchd/vswitch.ovsschema +++ b/vswitchd/vswitch.ovsschema @@ -30,7 +30,16 @@ "min": 0, "max": "unlimited"}}, "statistics": { "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}, - "ephemeral": true}}, + "ephemeral": true}, + "ovs_version": { + "type": {"key": {"type": "string"}, + "min": 0, "max": 1}}, + "system_type": { + "type": {"key": {"type": "string"}, + "min": 0, "max": 1}}, + "system_version": { + "type": {"key": {"type": "string"}, + "min": 0, "max": 1}}}, "maxRows": 1}, "Capability": { "columns": { diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 7b7a1ac9..9f079e86 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -28,12 +28,6 @@ choose key names that are likely to be unique. The currently defined common key-value pairs are:
-
system-type
-
An identifier for the switch type, such as - XenServer or KVM.
-
system-version
-
The version of the switch software, such as - 5.6.0 on XenServer.
system-id
A unique identifier for the Open vSwitch's physical host. The form of the identifier depends on the type of the host. @@ -201,6 +195,45 @@ + +

+ These columns report the types and versions of the hardware and + software running Open vSwitch. We recommend in general that software + should test whether specific features are supported instead of relying + on version number checks. These values are primarily intended for + reporting to human administrators. +

+ + + The Open vSwitch version number, e.g. 1.1.0pre2. + If Open vSwitch was configured with a build number, then it is + also included, e.g. 1.1.0pre2+build4948. + + + +

+ An identifier for the type of system on top of which Open vSwitch + runs, e.g. XenServer or KVM. +

+

+ System integrators are responsible for choosing and setting an + appropriate value for this column. +

+
+ + +

+ The version of the system identified by , + e.g. 5.5.0-24648p on XenServer 5.5.0 build 24648. +

+

+ System integrators are responsible for choosing and setting an + appropriate value for this column. +

+
+ +
+

These columns primarily configure the Open vSwitch database diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index 5f18196c..0a2fc780 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -298,10 +298,12 @@ EOF function set_system_ids { if [ -f /etc/xensource-inventory ]; then + OVS_VERSION=`ovs-vswitchd --version | sed 's/.*) //;1q'` action "Configuring Open vSwitch system IDs" true $vsctl --no-wait --timeout=5 set Open_vSwitch . \ - external-ids:system-type="$PRODUCT_BRAND" \ - external-ids:system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \ + ovs-version="$OVS_VERSION" \ + system-type="$PRODUCT_BRAND" \ + system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \ external-ids:system-id="$INSTALLATION_UUID" \ external-ids:xs-system-uuid="$INSTALLATION_UUID" else