From: Ian Campbell Date: Wed, 9 Sep 2009 17:09:00 +0000 (+0100) Subject: Move vswitch state files to /var/lib. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e44d18446300163c9c3026e4cdcbb8ec4ab8907e;p=openvswitch Move vswitch state files to /var/lib. I believe this is the correct location for files of this type. --- diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif index c3baba9e..8217fb00 100755 --- a/xenserver/etc_xensource_scripts_vif +++ b/xenserver/etc_xensource_scripts_vif @@ -71,8 +71,8 @@ add_to_bridge() logger -t scripts-vif "Adding ${vif} to ${bridge} with address ${address}" vid= - if [ -e "/etc/openvswitch/br-$bridge" ]; then - . "/etc/openvswitch/br-$bridge" + if [ -e "/var/lib/openvswitch/br-$bridge" ]; then + . "/var/lib/openvswitch/br-$bridge" if [ -n "$VLAN_SLAVE" -a -n "$VLAN_VID" ]; then bridge=$VLAN_SLAVE vid="--add=vlan.$vif.tag=$VLAN_VID" diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure index 61027c5f..f4afc9f3 100755 --- a/xenserver/opt_xensource_libexec_interface-reconfigure +++ b/xenserver/opt_xensource_libexec_interface-reconfigure @@ -71,8 +71,8 @@ output_directory = None db = None management_pif = None -dbcache_file = "/etc/ovs-vswitch.dbcache" -vswitch_config_dir = "/etc/openvswitch" +vswitch_state_dir = "/var/lib/openvswitch/" +dbcache_file = vswitch_state_dir + "dbcache" class Usage(Exception): def __init__(self, msg): @@ -1131,9 +1131,9 @@ def action_up(pif): # /etc/xensource/scripts/vif needs to know where to add VIFs. if vlan_slave: - if not os.path.exists(vswitch_config_dir): - os.mkdir(vswitch_config_dir) - br = ConfigurationFile("br-%s" % bridge, vswitch_config_dir) + if not os.path.exists(vswitch_state_dir): + os.mkdir(vswitch_state_dir) + br = ConfigurationFile("br-%s" % bridge, vswitch_state_dir) br.write("VLAN_SLAVE=%s\n" % datapath) br.write("VLAN_VID=%s\n" % pifrec['VLAN']) br.close() @@ -1233,7 +1233,7 @@ def action_up(pif): argv += ['--add=iface.%s.fake-bridge=true' % (ipdev)] else: try: - os.unlink("%s/br-%s" % (vswitch_config_dir, bridge)) + os.unlink("%s/br-%s" % (vswitch_state_dir, bridge)) except OSError: pass argv += ['--del-match=bridge.%s.xs-network-uuids=*' % datapath]