2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

xenserver: Rename ovs-external-ids to ovs-xapi-sync.

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@nicira.com>
This commit is contained in:
Justin Pettit
2011-02-11 12:35:37 -08:00
committed by Andrew Evans
parent 34edeccfd8
commit a49fe70cde
5 changed files with 23 additions and 17 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
;;

View File

@@ -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

View File

@@ -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)