[ovs-dev] [RPMs v2 3/4] xenserver: Rename ovs-external-ids to ovs-xapi-sync.
Justin Pettit
jpettit at nicira.com
Fri Feb 11 20:35:37 UTC 2011
With commit 5692e3 (xenserver: Set fail_mode on internal bridges.), the
responsibilities of ovs-external-ids got expanded beyond just monitoring
external-ids. This commit renames the script to more accurately
describe its job.
Signed-off-by: Justin Pettit <jpettit at nicira.com>
---
xenserver/README | 5 +++--
xenserver/automake.mk | 2 +-
xenserver/etc_init.d_openvswitch | 12 ++++++------
xenserver/openvswitch-xen.spec | 6 +++---
...=> usr_share_openvswitch_scripts_ovs-xapi-sync} | 15 ++++++++++-----
5 files changed, 23 insertions(+), 17 deletions(-)
rename xenserver/{usr_share_openvswitch_scripts_ovs-external-ids => usr_share_openvswitch_scripts_ovs-xapi-sync} (95%)
diff --git a/xenserver/README b/xenserver/README
index 7dee41a..5023de2 100644
--- a/xenserver/README
+++ b/xenserver/README
@@ -46,10 +46,11 @@ files are:
Open vSwitch-aware replacement for Citrix script of the same name.
- usr_share_openvswitch_scripts_ovs-external-ids
+ usr_share_openvswitch_scripts_ovs-xapi-sync
Daemon to monitor the external_ids columns of the Bridge and
- Interface OVSDB tables.
+ Interface OVSDB tables for changes that require interrogating
+ XAPI.
usr_share_openvswitch_scripts_sysconfig.template
diff --git a/xenserver/automake.mk b/xenserver/automake.mk
index aa5e7f5..6c0268d 100644
--- a/xenserver/automake.mk
+++ b/xenserver/automake.mk
@@ -23,6 +23,6 @@ EXTRA_DIST += \
xenserver/opt_xensource_libexec_interface-reconfigure \
xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
xenserver/usr_sbin_xen-bugtool \
- xenserver/usr_share_openvswitch_scripts_ovs-external-ids \
+ xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync \
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 8df0ed8..34fbc97 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -125,8 +125,8 @@ else
fi
function hup_monitor_external_ids {
- if [ -e /var/run/openvswitch/ovs-external-ids.pid ]; then
- action "Configuring Open vSwitch external IDs" kill -HUP `cat /var/run/openvswitch/ovs-external-ids.pid`
+ if [ -e /var/run/openvswitch/ovs-xapi-sync.pid ]; then
+ action "Configuring Open vSwitch external IDs" kill -HUP `cat /var/run/openvswitch/ovs-xapi-sync.pid`
fi
}
@@ -364,7 +364,7 @@ function start {
if [ -f /etc/xensource-inventory ]; then
# Start daemon to monitor external ids
PYTHONPATH=/usr/share/openvswitch/python \
- /usr/share/openvswitch/scripts/ovs-external-ids \
+ /usr/share/openvswitch/scripts/ovs-xapi-sync \
--pidfile --detach $monitor_opt "$VSWITCHD_OVSDB_SERVER"
fi
@@ -374,8 +374,8 @@ function start {
function stop {
stop_daemon VSWITCHD "$vswitchd"
stop_daemon OVSDB_SERVER "$ovsdb_server"
- if [ -e /var/run/openvswitch/ovs-external-ids.pid ]; then
- kill `cat /var/run/openvswitch/ovs-external-ids.pid`
+ if [ -e /var/run/openvswitch/ovs-xapi-sync.pid ]; then
+ kill `cat /var/run/openvswitch/ovs-xapi-sync.pid`
fi
rm -f /var/lock/subsys/openvswitch
}
@@ -444,7 +444,7 @@ case "$1" in
;;
reload|force-reload)
# Nothing to do to ovs-vswitchd and ovsdb-server as they keep their
- # configuration up-to-date all the time. HUP ovs-external-ids so it
+ # configuration up-to-date all the time. HUP ovs-xapi-sync so it
# re-runs.
hup_monitor_external_ids
;;
diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec
index 9a533a8..1df6dff 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_ovs-external-ids \
- $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/ovs-external-ids
+install -m 755 xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync \
+ $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/ovs-xapi-sync
install -m 755 xenserver/usr_sbin_xen-bugtool \
$RPM_BUILD_ROOT/usr/share/openvswitch/scripts/xen-bugtool
install -m 755 xenserver/usr_share_openvswitch_scripts_sysconfig.template \
@@ -305,7 +305,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/ovs-external-ids
+/usr/share/openvswitch/scripts/ovs-xapi-sync
/usr/share/openvswitch/scripts/interface-reconfigure
/usr/share/openvswitch/scripts/InterfaceReconfigure.py
/usr/share/openvswitch/scripts/InterfaceReconfigureBridge.py
diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-external-ids b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
similarity index 95%
rename from xenserver/usr_share_openvswitch_scripts_ovs-external-ids
rename to xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
index 77283fe..4d030fd 100755
--- a/xenserver/usr_share_openvswitch_scripts_ovs-external-ids
+++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
@@ -15,9 +15,12 @@
# A daemon to monitor the external_ids columns of the Bridge and
-# Interface OVSDB tables. Its primary responsibility is to set the
-# "bridge-id" and "iface-id" keys in the Bridge and Interface tables,
-# respectively.
+# Interface OVSDB tables for changes that require interrogating XAPI.
+# Its responsibilities include:
+#
+# - Set the "bridge-id" key in the Bridge table.
+# - Set the "iface-id" key in the Interface table.
+# - Set the fail-mode on internal bridges.
import getopt
import logging, logging.handlers
@@ -35,9 +38,9 @@ import ovs.util
import ovs.daemon
import ovs.db.idl
-s_log = logging.getLogger("ovs-external-ids")
+s_log = logging.getLogger("ovs-xapi-sync")
l_handler = logging.handlers.RotatingFileHandler(
- "/var/log/openvswitch/ovs-external-ids.log")
+ "/var/log/openvswitch/ovs-xapi-sync.log")
l_formatter = logging.Formatter('%(filename)s: %(levelname)s: %(message)s')
l_handler.setFormatter(l_formatter)
s_log.addHandler(l_handler)
@@ -124,6 +127,8 @@ def set_external_id(table, record, key, value):
col = 'external-ids:"' + key + '"="' + value + '"'
call_vsctl(["set", table, record, col])
+# XenServer does not call interface-reconfigure on internal networks,
+# which is where the fail-mode would normally be set.
def update_fail_mode(name):
rec = get_network_by_bridge(name)
--
1.7.1
More information about the dev
mailing list