X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-vsctl.c;h=21ac777e2407fc49a001eea467bded3ac16e102f;hb=7685b7a9e5b3f6db6832e52e111000ff36d3acb4;hp=0527885b35a77d637ef5eb9d20c1a54dc31757b3;hpb=cc36576070df622d0fc7a6e26ce01027e12b5b59;p=sliver-openvswitch.git diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 0527885b3..21ac777e2 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -31,6 +31,7 @@ #include "compiler.h" #include "dirs.h" #include "dynamic-string.h" +#include "fatal-signal.h" #include "hash.h" #include "json.h" #include "ovsdb-data.h" @@ -176,7 +177,7 @@ main(int argc, char *argv[]) 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(); @@ -391,6 +392,7 @@ parse_options(int argc, char *argv[], struct shash *local_options) case 'V': ovs_print_version(0, 0); + printf("DB Schema %s\n", ovsrec_get_db_version()); exit(EXIT_SUCCESS); case 't': @@ -3352,6 +3354,7 @@ set_column(const struct vsctl_table_class *table, 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; @@ -3630,7 +3633,7 @@ post_create(struct vsctl_context *ctx) 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) { @@ -3748,7 +3751,7 @@ evaluate_relop(const struct ovsdb_datum *a, const struct ovsdb_datum *b, return ovsdb_datum_includes_all(b, a, type); default: - NOT_REACHED(); + OVS_NOT_REACHED(); } } @@ -4058,7 +4061,7 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, 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(). */ @@ -4079,7 +4082,7 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, vsctl_fatal("database not locked"); default: - NOT_REACHED(); + OVS_NOT_REACHED(); } free(error); @@ -4122,6 +4125,11 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, 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) {