post v1.1.0
------------------------
+
+ - A new log level "off" has been added. Configuring a log facility
+ "off" prevents any messages from being logged to it. Previously,
+ "emer" was effectively "off" because no messages were ever logged at
+ level "emer". Now, errors that cause a process to exit are logged
+ at "emer" level.
- The new "-s" option for "ovs-dpctl show" prints packet and byte
counters for each port.
- ovs-ofctl:
}
/* Disable logging to stderr to avoid wasting CPU time. */
- vlog_set_levels(NULL, VLF_CONSOLE, VLL_EMER);
+ vlog_set_levels(NULL, VLF_CONSOLE, VLL_OFF);
}
/* If daemonization is configured, then starts daemonization, by forking and
The log level for the \fBfile\fR facility has no effect unless
\fB\*(PN\fR was invoked with the \fB\-\-log\-file\fR option.
.IP \(bu
-\fIlevel\fR must be one of \fBemer\fR, \fBerr\fR, \fBwarn\fR,
+\fIlevel\fR must be one of \fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR,
\fBinfo\fR, or
\fBdbg\fR, designating the minimum severity of a message for it to be
logged. If it is omitted, \fIlevel\fR defaults to \fBdbg\fR.
{
enum vlog_facility facility;
- module->min_level = VLL_EMER;
+ module->min_level = VLL_OFF;
for (facility = 0; facility < VLF_N_FACILITIES; facility++) {
if (log_file || facility != VLF_FILE) {
enum vlog_level level = module->levels[facility];
}
void
-vlog_fatal_valist(const struct vlog_module *module_, enum vlog_level level,
+vlog_fatal_valist(const struct vlog_module *module_,
const char *message, va_list args)
{
struct vlog_module *module = (struct vlog_module *) module_;
/* Don't log this message to the console to avoid redundancy with the
* message written by the later ovs_fatal_valist(). */
- module->levels[VLF_CONSOLE] = VLL_EMER;
+ module->levels[VLF_CONSOLE] = VLL_OFF;
- vlog_valist(module, level, message, args);
+ vlog_valist(module, VLL_EMER, message, args);
ovs_fatal_valist(0, message, args);
}
void
-vlog_fatal(const struct vlog_module *module, enum vlog_level level,
- const char *message, ...)
+vlog_fatal(const struct vlog_module *module, const char *message, ...)
{
va_list args;
va_start(args, message);
- vlog_fatal_valist(module, level, message, args);
+ vlog_fatal_valist(module, message, args);
va_end(args);
}
extern "C" {
#endif
-/* Logging importance levels.
+/* Logging severity levels.
*
- * The following log levels, in descending order of importance, are enabled by
+ * A logging severity level of OFF suppresses logging. Messages at the
+ * following log levels, in descending order of importance, are enabled by
* default:
*
- * - EMER: Not currently used.
+ * - EMER: The process is aborting due to unrecoverable failure.
*
* - ERR: A high-level operation or a subsystem failed. Attention is
* warranted.
* system, or that would commonly cause too-voluminous log output.
*/
#define VLOG_LEVELS \
+ VLOG_LEVEL(OFF, LOG_ALERT) \
VLOG_LEVEL(EMER, LOG_ALERT) \
VLOG_LEVEL(ERR, LOG_ERR) \
VLOG_LEVEL(WARN, LOG_WARNING) \
const char *, va_list)
PRINTF_FORMAT (3, 0);
-void vlog_fatal(const struct vlog_module *, enum vlog_level,
- const char *format, ...)
- PRINTF_FORMAT (3, 4) NO_RETURN;
-void vlog_fatal_valist(const struct vlog_module *, enum vlog_level,
- const char *, va_list)
- PRINTF_FORMAT (3, 0) NO_RETURN;
+void vlog_fatal(const struct vlog_module *, const char *format, ...)
+ PRINTF_FORMAT (2, 3) NO_RETURN;
+void vlog_fatal_valist(const struct vlog_module *, const char *format, va_list)
+ PRINTF_FORMAT (2, 0) NO_RETURN;
void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
struct vlog_rate_limit *, const char *, ...)
*
* Guaranteed to preserve errno.
*/
-#define VLOG_FATAL(...) vlog_fatal(THIS_MODULE, VLL_ERR, __VA_ARGS__)
+#define VLOG_FATAL(...) vlog_fatal(THIS_MODULE, __VA_ARGS__)
#define VLOG_EMER(...) VLOG(VLL_EMER, __VA_ARGS__)
#define VLOG_ERR(...) VLOG(VLL_ERR, __VA_ARGS__)
#define VLOG_WARN(...) VLOG(VLL_WARN, __VA_ARGS__)
/* More convenience macros, for testing whether a given level is enabled in
* THIS_MODULE. When constructing a log message is expensive, this enables it
* to be skipped. */
-#define VLOG_IS_EMER_ENABLED() true
#define VLOG_IS_ERR_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_ERR)
#define VLOG_IS_WARN_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_WARN)
#define VLOG_IS_INFO_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_INFO)
below).
.
.IP \(bu
-\fIlevel\fR must be one of \fBemer\fR, \fBerr\fR, \fBwarn\fR,
+\fIlevel\fR must be one of \fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR,
\fBinfo\fR, or
\fBdbg\fR, designating the minimum severity of a message for it to be
logged. If it is omitted, \fIlevel\fR defaults to \fBdbg\fR.
configure_datapath: physical - [u'eth2']
configure_datapath: extra ports - []
configure_datapath: extra bonds - []
-/usr/bin/ovs-vsctl --timeout=5 -vANY:console:emer get-fail-mode xenbr2
+/usr/bin/ovs-vsctl --timeout=5 -vANY:console:off get-fail-mode xenbr2
Applying changes to /etc/sysconfig/network-scripts/route-xenbr2 configuration
Applying changes to /etc/sysconfig/network configuration
Applying changes to /etc/sysconfig/network-scripts/ifcfg-xenbr2 configuration
set Bridge xenbr2 fail_mode=secure
remove Bridge xenbr2 other_config disable-in-band
br-set-external-id xenbr2 xs-network-uuids d08c8749-0c8f-9e8d-ce25-fd364661ee99
-/usr/bin/ovs-vsctl --timeout=5 -vANY:console:emer get interface eth2 ofport
+/usr/bin/ovs-vsctl --timeout=5 -vANY:console:off get interface eth2 ofport
/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=5,arp,nw_proto=1,actions=local
/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=local,arp,dl_src=00:15:17:a0:29:80,actions=5
/usr/bin/ovs-ofctl add-flow xenbr2 idle_timeout=0,priority=0,in_port=5,dl_dst=00:15:17:a0:29:80,actions=local
/*
- * Copyright (c) 2009, 2010 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
int old_time;
char line[128];
- vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_EMER);
+ vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_OFF);
now = 1000;
reconnect = reconnect_create(now);
system log or to the console, respectively, or \fBANY\fR to set the
logging levels for both facilities. If it is omitted,
\fIfacility\fR defaults to \fBANY\fR. The \fIlevel\fR must be one of
-\fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or \fBdbg\fR, designating the
+\fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or
+\fBdbg\fR, designating the
minimum severity of a message for it to be logged. If it is omitted,
\fIlevel\fR defaults to \fBdbg\fR.
.
static void
usage(void)
{
- printf("%s, for querying and controlling Open vSwitch daemon\n"
- "usage: %s [TARGET] COMMAND [ARG...]\n"
- "Targets:\n"
- " -t, --target=TARGET pidfile or socket to contact\n"
- "Common commands:\n"
- " help List commands supported by the target\n"
- " vlog/list List current logging levels\n"
- " vlog/set MODULE[:FACILITY[:LEVEL]]\n"
- " Set MODULE and FACILITY log level to LEVEL\n"
- " MODULE may be any valid module name or 'ANY'\n"
- " FACILITY may be 'syslog', 'console', 'file', or 'ANY' (default)\n"
- " LEVEL may be 'emer', 'err', 'warn', 'info', or 'dbg' (default)\n"
- " vlog/reopen Make the program reopen its log file\n"
- "Other options:\n"
- " -h, --help Print this helpful information\n"
- " -V, --version Display version information\n",
+ printf("\
+%s, for querying and controlling Open vSwitch daemon\n\
+usage: %s [TARGET] COMMAND [ARG...]\n\
+Targets:\n\
+ -t, --target=TARGET pidfile or socket to contact\n\
+Common commands:\n\
+ help List commands supported by the target\n\
+ vlog/list List current logging levels\n\
+ vlog/set MODULE[:FACILITY[:LEVEL]]\n\
+ Set MODULE and FACILITY log level to LEVEL\n\
+ MODULE may be any valid module name or 'ANY'\n\
+ FACILITY may be 'syslog', 'console', 'file', or 'ANY' (default)\n\
+ LEVEL may be 'off', 'emer', 'err', 'warn', 'info', or 'dbg' (default)\n\
+ vlog/reopen Make the program reopen its log file\n\
+Other options:\n\
+ -h, --help Print this helpful information\n\
+ -V, --version Display version information\n",
program_name, program_name);
exit(EXIT_SUCCESS);
}
}
ovsdb_tool () {
- ovsdb-tool -vANY:console:emer "$@"
+ ovsdb-tool -vANY:console:off "$@"
}
create_db () {
message = xvasprintf(format, args);
va_end(args);
- vlog_set_levels(&VLM_vsctl, VLF_CONSOLE, VLL_EMER);
+ vlog_set_levels(&VLM_vsctl, VLF_CONSOLE, VLL_OFF);
VLOG_ERR("%s", message);
ovs_error(0, "%s", message);
vsctl_exit(EXIT_FAILURE);
"--", "set-manager", 'ssl:' + controller + ':6632'])
def vswitchCfgQuery(action_args):
- cmd = [vsctl, "--timeout=5", "-vANY:console:emer"] + action_args
+ cmd = [vsctl, "--timeout=5", "-vANY:console:off"] + 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, "--timeout=5", "-vANY:console:emer"] + action_args
+ cmd = [vsctl, "--timeout=5", "-vANY:console:off"] + action_args
exitcode = subprocess.call(cmd)
if exitcode != 0:
raise XenAPIPlugin.Failure("VSWITCH_CONFIG_MOD_FAILURE",
install -d -m 755 -o root -g root /etc/openvswitch
# Create ovs-vswitchd config database
- ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \
+ ovsdb-tool -vANY:console:off create /etc/openvswitch/conf.db \
/usr/share/openvswitch/vswitch.ovsschema
# Create initial table in config database
- ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \
+ ovsdb-tool -vANY:console:off transact /etc/openvswitch/conf.db \
'[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \
> /dev/null
fi
def vswitchCfgQuery(action_args):
cmd = ['%s/usr/bin/ovs-vsctl' % root_prefix(),
- '--timeout=5', '-vANY:console:emer'] + action_args
+ '--timeout=5', '-vANY:console:off'] + action_args
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
if len(output) == 0 or output[0] == None:
output = ""
-# Copyright (c) 2007-2010 Citrix Systems Inc.
+# Copyright (c) 2007-2011 Citrix Systems Inc.
# Copyright (c) 2009,2010,2011 Nicira Networks.
#
# This program is free software; you can redistribute it and/or modify
@staticmethod
def Get(action):
try:
- arg = [vsctl, "--timeout=30", "-vANY:console:emer"] + action.split()
+ arg = [vsctl, "--timeout=30", "-vANY:console:off"] + action.split()
output = ShellPipe(arg).Stdout()
except StandardError, e:
XSLogError("config retrieval error: " + str(e))
return xs_vif_uuid
def call_vsctl(args):
- cmd = [vsctl, "--timeout=30", "-vANY:console:emer"] + args
+ cmd = [vsctl, "--timeout=30", "-vANY:console:off"] + args
exitcode = subprocess.call(cmd)
if exitcode != 0:
s_log.warning("Couldn't call ovs-vsctl")