[vxlan_sys]],
[
# Try creating the port
-AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [dnl
+cat >experr <<EOF
ovs-vsctl: Error detected while setting up 'reserved_name'. See ovs-vswitchd log for details.
-])
+ovs-vsctl: The default log directory is "$OVS_RUNDIR".
+EOF
+AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [experr])
# Prevent race.
OVS_WAIT_UNTIL([test `grep -- "|WARN|" ovs-vswitchd.log | wc -l` -ge 1])
# Detect the warning log message
[vxlan_sys]],
[
# Try creating the port
-AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [dnl
+cat >experr <<EOF
ovs-vsctl: Error detected while setting up 'reserved_name'. See ovs-vswitchd log for details.
-])
+ovs-vsctl: The default log directory is "$OVS_RUNDIR".
+EOF
+AT_CHECK([ovs-vsctl add-port br0 reserved_name], [0], [], [experr])
# Prevent race.
OVS_WAIT_UNTIL([test `grep -- "|WARN|" ovs-vswitchd.log | wc -l` -ge 1])
# Detect the warning log message
# Create a bridge with an unsafe name and make sure that the management
# socket does not get created.
mkdir b
-AT_CHECK([ovs-vsctl add-br b/c -- set bridge b/c datapath-type=dummy], [0],
- [], [ovs-vsctl: Error detected while setting up 'b/c'. See ovs-vswitchd log for details.
-])
+
+cat >experr <<EOF
+ovs-vsctl: Error detected while setting up 'b/c'. See ovs-vswitchd log for details.
+ovs-vsctl: The default log directory is "$OVS_RUNDIR".
+EOF
+AT_CHECK([ovs-vsctl add-br b/c -- set bridge b/c datapath-type=dummy], [0], [], [experr])
AT_CHECK([test ! -e b/c.mgmt])
OVS_VSWITCHD_STOP(['/ignoring bridge with invalid name/d'])
#include "command-line.h"
#include "compiler.h"
+#include "dirs.h"
#include "openvswitch/dynamic-string.h"
#include "fatal-signal.h"
#include "hash.h"
ovsdb_idl_add_column(ctx->idl, &ovsrec_interface_col_name);
ovsdb_idl_add_column(ctx->idl, &ovsrec_interface_col_ofport);
+ ovsdb_idl_add_column(ctx->idl, &ovsrec_interface_col_error);
}
static void
static void
post_db_reload_do_checks(const struct vsctl_context *vsctl_ctx)
{
- struct ds dead_ifaces = DS_EMPTY_INITIALIZER;
+ bool print_error = false;
size_t i;
for (i = 0; i < n_neoteric_ifaces; i++) {
iface = ovsrec_interface_get_for_uuid(vsctl_ctx->base.idl, uuid);
if (iface && (!iface->ofport || *iface->ofport == -1)) {
- ds_put_format(&dead_ifaces, "'%s', ", iface->name);
+ if (iface->error && *iface->error) {
+ ovs_error(0, "Error detected while setting up '%s': %s. "
+ "See ovs-vswitchd log for details.",
+ iface->name, iface->error);
+ } else {
+ ovs_error(0, "Error detected while setting up '%s'. "
+ "See ovs-vswitchd log for details.",
+ iface->name);
+ }
+ print_error = true;
}
}
}
- if (dead_ifaces.length) {
- dead_ifaces.length -= 2; /* Strip off trailing comma and space. */
- ovs_error(0, "Error detected while setting up %s. See ovs-vswitchd "
- "log for details.", ds_cstr(&dead_ifaces));
+ if (print_error) {
+ ovs_error(0, "The default log directory is \"%s\".", ovs_logdir());
}
-
- ds_destroy(&dead_ifaces);
}
\f