#include "compiler.h"
#include "dirs.h"
#include "dynamic-string.h"
+#include "fatal-signal.h"
#include "hash.h"
#include "json.h"
#include "ovsdb-data.h"
char *args;
set_program_name(argv[0]);
- signal(SIGPIPE, SIG_IGN);
+ fatal_ignore_sigpipe();
vlog_set_levels(NULL, VLF_CONSOLE, VLL_WARN);
vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_WARN);
ovsrec_init();
case 'V':
ovs_print_version(0, 0);
+ printf("DB Schema %s\n", ovsrec_get_db_version());
exit(EXIT_SUCCESS);
case 't':
ovsdb_datum_union(&datum, ovsdb_idl_read(row, column),
&column->type, false);
+ ovsdb_idl_txn_verify(row, column);
ovsdb_idl_txn_write(row, column, &datum);
} else {
struct ovsdb_datum datum;
struct uuid dummy;
if (!uuid_from_string(&dummy, ds_cstr(&ctx->output))) {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
real = ovsdb_idl_txn_get_insert_uuid(ctx->txn, &dummy);
if (real) {
return ovsdb_datum_includes_all(b, a, type);
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
switch (status) {
case TXN_UNCOMMITTED:
case TXN_INCOMPLETE:
- NOT_REACHED();
+ OVS_NOT_REACHED();
case TXN_ABORTED:
/* Should not happen--we never call ovsdb_idl_txn_abort(). */
vsctl_fatal("database not locked");
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
free(error);
free(commands);
if (wait_for_reload && status != TXN_UNCHANGED) {
+ /* Even, if --retry flag was not specified, ovs-vsctl still
+ * has to retry to establish OVSDB connection, if wait_for_reload
+ * was set. Otherwise, ovs-vsctl would end up waiting forever
+ * until cur_cfg would be updated. */
+ ovsdb_idl_enable_reconnect(idl);
for (;;) {
ovsdb_idl_run(idl);
OVSREC_OPEN_VSWITCH_FOR_EACH (ovs, idl) {