echo " ERROR."
fi
- ovs-vsctl --no-wait init
+ ovs-vsctl --no-wait --timeout=5 init
# Start ovs-vswitchd.
set --
.
.IP "\fB\-t \fIsecs\fR"
.IQ "\fB\-\-timeout=\fIsecs\fR"
-Limits runtime to approximately \fIsecs\fR seconds. A value of
-zero will cause \fBovs\-vsctl\fR to wait forever. If the timeout expires,
-\fBovs\-vsctl\fR will exit with a \fBSIGALRM\fR signal. If this option is
-not used, \fBovs\-vsctl\fR uses a timeout of five seconds.
-(A timeout would normally happen only if the database cannot be contacted.)
+By default, or with a \fIsecs\fR of \fB0\fR, \fBovs\-vsctl\fR waits
+forever for a response from the database. This option limits runtime
+to approximately \fIsecs\fR seconds. If the timeout expires,
+\fBovs\-vsctl\fR will exit with a \fBSIGALRM\fR signal. (A timeout
+would normally happen only if the database cannot be contacted, or if
+the system is overloaded.)
.
.SS "Public Key Infrastructure Options"
.so lib/ssl.man
static bool wait_for_reload = true;
/* --timeout: Time to wait for a connection to 'db'. */
-static int timeout = 5;
+static int timeout;
/* All supported commands. */
static const struct vsctl_command_syntax all_commands[];
function set_system_ids {
if [ -f /etc/xensource-inventory ]; then
action "Configuring Open vSwitch system IDs" true
- $vsctl --no-wait set Open_vSwitch . \
+ $vsctl --no-wait --timeout=5 set Open_vSwitch . \
external-ids:system-type="$PRODUCT_BRAND" \
external-ids:system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \
external-ids:system-id="$INSTALLATION_UUID" \
fi
start_ovsdb_server
- $vsctl --no-wait init
+ $vsctl --no-wait --timeout=5 init
if [ ! -e /var/run/openvswitch.booted ]; then
touch /var/run/openvswitch.booted
for bridge in $($vsctl list-br); do
- $vsctl --no-wait del-br $bridge
+ $vsctl --no-wait --timeout=5 del-br $bridge
done
fi
'managers="ssl:' + controller + ':6632"'])
def vswitchCfgQuery(action_args):
- cmd = [vsctl, "-vANY:console:emer"] + action_args
+ cmd = [vsctl, "--timeout=5", "-vANY:console:emer"] + action_args
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
if len(output) == 0 or output[0] == None:
output = ""
return output
def vswitchCfgMod(action_args):
- cmd = [vsctl, "-vANY:console:emer"] + action_args
+ cmd = [vsctl, "--timeout=5", "-vANY:console:emer"] + action_args
exitcode = subprocess.call(cmd)
if exitcode != 0:
raise XenAPIPlugin.Failure("VSWITCH_CONFIG_MOD_FAILURE",
[ str(exitcode) , str(action_args) ])
def emergency_reset(session, args):
- cmd = [vsctl, "emer-reset"]
+ cmd = [vsctl, "--timeout=5", "emer-reset"]
exitcode = subprocess.call(cmd)
if exitcode != 0:
raise XenAPIPlugin.Failure("VSWITCH_EMER_RESET_FAILURE",
local vif_details=$(handle_vswitch_vif_details $bridge)
fi
- $vsctl -- --if-exists del-port $dev -- add-port $bridge $dev $vif_details
+ $vsctl --timeout=30 -- --if-exists del-port $dev -- add-port $bridge $dev $vif_details
;;
esac
# If ovs-brcompatd is running, it might already have deleted the
# port. Use --if-exists to suppress the error that would otherwise
# arise in that case.
- $vsctl -- --if-exists del-port $dev
+ $vsctl --timeout=30 -- --if-exists del-port $dev
;;
esac
}
@staticmethod
def Get(action):
try:
- arg = [vsctl, "-vANY:console:emer"] + action.split()
+ arg = [vsctl, "--timeout=30", "-vANY:console:emer"] + action.split()
output = ShellPipe(arg).Stdout()
except StandardError, e:
XSLogError("config retrieval error: " + str(e))
def call_vsctl(cmd, arg=""):
database = '--db=' + OVSDB_SERVER
- command = [VSCTL, database, cmd]
+ command = [VSCTL, '--timeout=30', database, cmd]
if (arg):
command.append(arg)
return subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0].split()
def set_external_id(table, record, key, value):
col = 'external-ids:"' + key + '"="' + value + '"'
- cmd = [vsctl, "-vANY:console:emer", "set", table, record, col]
+ cmd = [vsctl, "--timeout=30", "-vANY:console:emer", "set", table, record, col]
exitcode = subprocess.call(cmd)
if exitcode != 0:
syslog.syslog(syslog.LOG_WARNING,